Address collaborative document presence change detection and debounce#23760
Open
akabiru wants to merge 1 commit into
Open
Address collaborative document presence change detection and debounce#23760akabiru wants to merge 1 commit into
akabiru wants to merge 1 commit into
Conversation
Key the presence map by the real Yjs client id so the set-difference check detects identity swaps that keep the user count constant, and point the stimulus-use debounce at the method it actually wraps so avatar refreshes are throttled as intended.
|
Warning Flaky specs
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes two issues in the collaborative document live-events Stimulus controller that caused connected-user avatar presence to become stale and avatar refreshes to run without the intended debounce.
Changes:
- Fixes the Stimulus-use debounce configuration by targeting the actual
triggerUpdateUsersUImethod. - Corrects presence change detection by keying
currentUsersby the awareness state’sclientIdinstead of the array index.
brunopagno
approved these changes
Jun 16, 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.
Two latent bugs in the collaborative-document presence controller (
live-events.controller.ts), which renders connected-user avatars from the Yjs awareness protocol. The change-detector keyed its presence map by array index instead ofstate.clientId, so it only noticed when the user count changed and missed same-count membership swaps (one peer leaving as another joins) — leaving stale avatars; and the refresh debounce named a non-existent method (triggerUpdateUIvs the realtriggerUpdateUsersUI), so every awareness frame fetched immediately instead of throttling to 1s. Both fixed by keying on the real client id and pointing the debounce at the correct method.