Fix presence indicators not showing without cache #32880
Merged
t3chguy merged 2 commits intoelement-hq:developfrom Mar 23, 2026
Merged
Fix presence indicators not showing without cache #32880t3chguy merged 2 commits intoelement-hq:developfrom
t3chguy merged 2 commits intoelement-hq:developfrom
Conversation
79f646b to
a6cda05
Compare
Merged
via the queue into
element-hq:develop
with commit Mar 23, 2026
54d3ab9
45 of 47 checks passed
Contributor
Author
|
No problem, happy to be of help |
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.
Tested on Element Web v1.12.12, local dev server.
This issue does not happen on v1.12.2. There were changes to how the room list is rendered, which I believe to be impacting load timing.
Summary
Presence indicators in the DM room list do not appear on initial login (when the room is not in the sync cache).
When a room gets put in cache - for example by sending a message in the room -, the presence indicator for this room will appear on next refresh and update correctly from this point on.
Root cause
During initial sync,
RoomMember.useris not yet linked to the User object when the room list renders. TheusePresencehook reads presence frommember.user, which is null at that point.The
userobject exists in client store (client.getUser()), but the hook doesn't fall back to it.From my understanding, the room list renders before the SDK can link
RoomMember.userwhich causes this issue. On subsequent loads, theuserobjects are available early enough for the linking to succeed thanks to the cache.So, we end up with at least some rooms not having their presence rendered :
Fixes
getPresence, we fall back toclient.getUser(member.userId)whenmember.useris not linked.UserEvent.Presenceto catch presence update events whenmember.useris null since the event listener cannot subscribe to it.With these fixes, we end up with all 1:1 DM rooms having their presence rendered :
Notes
I believe the same linking issue also affects DM avatars on the first page load since they only render after a subsequent reload in Web.
If I am correct, the proper long-term fix should probably be in the SDK itself.