group-income icon indicating copy to clipboard operation
group-income copied to clipboard

Fixing sync issues for user identities in group chats: Ensuring display name and profile picture updates are visible to all members

Open corrideat opened this issue 2 years ago • 0 comments

Instructions

[Tab1] u1 signs up, and creates a group [Tab2] u2 joins the group [Tab3] u3 joins the group, and changes profile picture [Tab2] u2 sees the updated picture of u3, and leaves the group [Tab1] u1 changes his displayName [Tab2] u2 re-joins the group [Tab2] u2 can not see the current displayName of u1, because it is changed when u2 is not part of the group. In terms of technical point, u2 can not decrypt the event (to change displayName of u1) with the new PEKs. [Tab1] u1 changes profile picture [Tab2] u2 is updated with the updated profile picture of u1, but not with the displayName

Problem

u2 should see both the u1's updated profile picture AND updated displayName. This requires re-syncing u1's contract from scratch.

Solution

We need a way to detect this situation somehow when the group contract is re-synced by u2. This affects the processing of OP_KEY_SHARE, and what should happen is that, when we see that a new PEK was shared for u1, we re-sync the contract to rebuild state. A simpler, less-general alternative that is GI-specific would be to force re-sync all identity contracts when (re-)joining a group, since we know that a new PEK is needed.

corrideat avatar Feb 22 '24 16:02 corrideat