Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Fixes to profile avatar downloads & caching #24

Merged
merged 5 commits into from
Feb 22, 2024

Conversation

AndrewFerr
Copy link
Member

This should fix some issues with avatar syncing. It also includes a just-in-case nil check (replacing #23) to at least prevent the crash we've been encountering.

The overall design is: if a bridge user wants to update another Signal puppet's profile but is forbidden access of that Signal user's profile info, check if some other bridge user (with a valid Signal client connection) has access to it. If so, use that user's Signal connection + their key for the target Signal's profile to do the download, as if that bridge user was the one who requested the puppet profile update in the first place.

This also improves the accuracy of how profile avatar info gets saved to the bridge's storage, and seems to fix the problem we've been seeing of puppet avatars being slow to update or not updating at all. It should also prevent re-downloading avatars unnecessarily.

Upstream PR: mautrix#449 (commits)

- Store updates to profile avatar hashes in signalmeow_contacts
- Have puppets use the stored contact avatar hash rather than
  recomputing it
- Have puppets update their avatar path when the profile avatar path
  changed but the hash did not
- Have puppets clear their avatar path when using a contact avatar
  instead of a profile avatar
@AndrewFerr AndrewFerr requested a review from a team as a code owner February 22, 2024 15:30
@AndrewFerr AndrewFerr self-assigned this Feb 22, 2024
@AndrewFerr
Copy link
Member Author

Note that the merge conflict is already resolved in 7f72542.

Copy link
Member

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay to me 👍

@AndrewFerr AndrewFerr merged commit 7f72542 into element-main Feb 22, 2024
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants