Skip to content

Added 'profile_updated' to contact_info & member to version profile info #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

mpretty-cyro
Copy link
Collaborator

@mpretty-cyro mpretty-cyro commented Jul 11, 2025

There is currently a bug in Session where profile information can be overwritten with stale information, this is due to profile information contained within a message not containing any version information - a single scenario which results in this bug is:

  • Create two accounts (Alice and Bob)
  • Start a 1-to-1 conversation between them
  • Create a group with both accounts
  • Have both accounts send messages in both conversations
  • Have Alice update their profile information and send new messages into the 1-to-1 conversation
  • Have Bob restore their account on a new device

In the above scenario Bob will have downloaded and processed all 1-to-1 messages before receiving the group messages, once the group messages are processed their profile data will incorrectly overwrite the newer information that was attached to the 1-to-1 messages

The solution for this is to include a profile_updated timestamp alongside the profile information when sending a message - the client can then compare this against their cached information in order to determine whether they should update the cache

Since libSession stores profile information for contacts and group members it also needs to track this value which is the purpose of this PR

@mpretty-cyro mpretty-cyro requested a review from jagerman July 11, 2025 01:48
@mpretty-cyro mpretty-cyro self-assigned this Jul 11, 2025
@mpretty-cyro mpretty-cyro changed the title Added 'profile_seqno' to contact_info & member to version profile info Added 'profile_updated' to contact_info & member to version profile info Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant