Do not cache profiles when requested via getExtendedProfileProperty - #5491
Open
Half-Shot wants to merge 2 commits into
Open
Do not cache profiles when requested via getExtendedProfileProperty#5491Half-Shot wants to merge 2 commits into
getExtendedProfileProperty#5491Half-Shot wants to merge 2 commits into
Conversation
Member
|
Hmm, I don't love making implementation decisions based on what hasn't yet been implemented in a particular homeserver. It will still be sort of broken because the status still won't update unless the component gets re-mounted. The reason I added this was because otherwise the client will just keep requesting the status for users that haven't sent a status update so this will be quite a few extra requests and not just for federated users. If the concern is that we see stale statuses from federated users, a more appropriate fix might be to have synapse just not fetch federated statuses until it also supports streaming them? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The JS-SDK recently (#5246) introduced a cache that would locally store the state of a user's profile, which persists forever until /sync updates it with fresh information. Unfortunately, there is no upstream support for tracking federated users and so the profile ends up being incomplete.
The current behavior also stores a copy of a profile field when
getExtendedProfilePropertyis explicitly called, however since we can't tell if that user is "subscribed to" we don't know for sure if the cache will ever be updated.This PR therefore removes the mechanism to cache on profile request, but keeps it for profiles we are syncing via /sync. The end result is hopefully that we always have up-to-date information for users at the cost of extra requests made to the homeserver for federated users. When the syncing mechanism matures to support federated users, this should improve still further.
Checklist
public/exportedsymbols have accurate TSDoc documentation.