Skip to content

Address collaborative document presence change detection and debounce - #23760

Merged
akabiru merged 1 commit into
devfrom
bugfix/live-events-awareness-presence-key
Jun 16, 2026
Merged

Address collaborative document presence change detection and debounce#23760
akabiru merged 1 commit into
devfrom
bugfix/live-events-awareness-presence-key

Conversation

@akabiru

@akabiru akabiru commented Jun 15, 2026

Copy link
Copy Markdown
Member

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 of state.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 (triggerUpdateUI vs the real triggerUpdateUsersUI), 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.

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.
@github-actions

Copy link
Copy Markdown

Warning

Flaky specs

  • rspec ./modules/my_page/spec/features/my/work_package_table_spec.rb[1:1:1]

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 triggerUpdateUsersUI method.
  • Corrects presence change detection by keying currentUsers by the awareness state’s clientId instead of the array index.

@akabiru akabiru changed the title Bugfix: Fix collaborative document presence change detection and debounce Adress collaborative document presence change detection and debounce Jun 15, 2026
@akabiru akabiru changed the title Adress collaborative document presence change detection and debounce Address collaborative document presence change detection and debounce Jun 15, 2026
@akabiru akabiru self-assigned this Jun 15, 2026
@akabiru akabiru added this to the 17.6.x milestone Jun 15, 2026
@akabiru
akabiru requested a review from brunopagno June 15, 2026 17:13
@akabiru
akabiru marked this pull request as ready for review June 15, 2026 17:13
@akabiru
akabiru merged commit fdc2440 into dev Jun 16, 2026
19 of 20 checks passed
@akabiru
akabiru deleted the bugfix/live-events-awareness-presence-key branch June 16, 2026 12:15
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Development

Successfully merging this pull request may close these issues.

3 participants