Skip to content

fix: re-assert join after sliding sync reverts optimistic join to invite - #1251

Merged
7w1 merged 2 commits into
SableClient:devfrom
eleboucher:fix/sliding-sync-invite-join-and-listener-leak
Jul 23, 2026
Merged

fix: re-assert join after sliding sync reverts optimistic join to invite#1251
7w1 merged 2 commits into
SableClient:devfrom
eleboucher:fix/sliding-sync-invite-join-and-listener-leak

Conversation

@eleboucher

@eleboucher eleboucher commented Jul 23, 2026

Copy link
Copy Markdown
Member

Description

Fixes #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

@eleboucher
eleboucher requested review from 7w1 and hazre as code owners July 23, 2026 15:51
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
eleboucher force-pushed the fix/sliding-sync-invite-join-and-listener-leak branch from 31de16e to 4c6588f Compare July 23, 2026 15:51
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
eleboucher force-pushed the fix/sliding-sync-invite-join-and-listener-leak branch from 4c6588f to 02172cc Compare July 23, 2026 15:51
@7w1 7w1 added the internal label Jul 23, 2026
@7w1
7w1 added this pull request to the merge queue Jul 23, 2026
Merged via the queue into SableClient:dev with commit d05aef8 Jul 23, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants