fix: re-assert join after sliding sync reverts optimistic join to invite - #1251
Merged
7w1 merged 2 commits intoJul 23, 2026
Merged
Conversation
After joinRoom succeeds, the server's sliding-sync proxy can keep a room in the is_invite list for 1+ cycles, sending invite_state that the SDK injects as m.room.member with membership=invite. room.recalculate() then reverts selfMembership back to invite, moving the room back into the invite list and suppressing notifications (getUnreadInfos gates on getMyMembership !== join). Track optimistically joined rooms, subscribe them so real joined state flows in, and re-assert Join after each sync Complete until the server catches up.
eleboucher
force-pushed
the
fix/sliding-sync-invite-join-and-listener-leak
branch
from
July 23, 2026 15:51
31de16e to
4c6588f
Compare
useCallSession subscribed to mx.matrixRTC.on('session_started'/'session_ended')
once per call, and is used by RoomNavItem (one per visible room). With 11+
visible rooms this exceeded Node's default EventEmitter limit of 10 and
stacked O(N) listeners that each did O(1) filtering per event.
Move the subscription into a single MatrixRTCSessionProvider that exposes
active RTC session room IDs via React context. useCallSession now reads
from that context instead of subscribing per-room.
eleboucher
force-pushed
the
fix/sliding-sync-invite-join-and-listener-leak
branch
from
July 23, 2026 15:51
4c6588f to
02172cc
Compare
7w1
approved these changes
Jul 23, 2026
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.
Description
Fixes #
Type of change
Checklist:
AI disclosure: