Skip to content

getExtendedProfileProperty() can return stale profile entries as it uses a cache without a TTL #5402

Description

@Half-Shot

https://github.com/matrix-org/matrix-js-sdk/blob/develop/src/client.ts#L7430 was recently changed to use a persistent cache for profile keys, as there is now the ability (via MSCXXXX) to sync profile changes from the homeserver. However there are a couple of catches:

  • Not all keys from a profile are synced, but a filtered set.
  • Not all homeserver implementations support federated profile change updates, so federated users will be stale.

getExtendedProfileProperty will also store the result of an explicit fetch from the homeserver in the cache, and will keep it there forever. Therefore over time the client will build up a set of forever cached properties if they rely on this function.

The solution is probably to either not cache the results, or cache with a TTL such that a profile can only be so many minutes behind. The cache exists to ensure that on restart the client doesn't hammer the homeserver with many requests, so there needs to be some thought put into when to expire the caches.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Technical-DebtO-FrequentAffects or can be seen by most users regularly or impacts most users' first experienceS-MinorImpairs non-critical functionality or suitable workarounds existT-Defect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions