Repository navigation
Tell a second person apart from your own second tab - #154
Open
chriszarate wants to merge 2 commits into
Open
chriszarate wants to merge 2 commits into
chriszarate wants to merge 2 commits into
Conversation
Sync answers on every transport (polling, SSE streams, the websocket daemon's pushes) now carry awareness_users beside the awareness map: client id to WordPress user id. The awareness state itself is unchanged. The polling manager counts people, not entries, when it checks the room limit and when it decides whether the awareness map means company. Your own other tab still keeps company through the advisory lane's heartbeat answer, so edits keep flowing between your tabs. Fixes #147.
josephfusco
reviewed
Oct 7, 2026
Collaborator
There was a problem hiding this comment.
Three things before this goes in:
- With the advisory channel on (the default), my own second tab still puts polling on the two-person rate, because the heartbeat's
others_present()still counts tabs, not people. - I think the fix belongs on the server: if
others_present()andhas_live_awareness_besides()count people, the heartbeat and polling answers will agree. - Tabs without a user id come through as
0, socountPeoplelumps them into one person and undercounts both the editor limit and the company check.
3 of 5 tasks
Collaborator
|
@copilot resolve the merge conflicts in this pull request |
Contributor
This branch already includes commit |
Collaborator
|
@copilot resolve the merge conflicts in this pull request |
Contributor
Merge commit |
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.
Fixes #147.
The editor now tells a second person apart from your own second tab. Before this change, opening a post in two tabs made you look like two people. The editor switched to the faster polling speed it uses when two people edit. Your fourth tab was refused with "Too many editors", as if the post were full.
What changed
awareness_users. It says which WordPress user each open tab belongs to. All three connection types send it: regular polling, SSE (a stream the browser keeps open), and the websocket server.isFieldEqualingutenberg/packages/core-data/src/awareness/awareness-state.ts). This design was approved in the issue.awareness_userslist (an older server), each tab counts as its own person, as before.Your own tabs still share edits with each other. WordPress's background check-in still lists your other tabs, so a tab does not stop checking for changes while you have another one open. Those tabs now poll at the normal speed for one person.
Whether the collaborators list shows your own tabs as one person is up to WordPress/gutenberg#78700. This change only gives it the data.
Testing
npm run test:php -- --filter wpHttpPollingSyncServer: 67 tests pass.npm run test:js -- polling-manager: 94 tests pass.composer lintare clean.