Repository navigation
Keep a lone collab editor off the 2.5 s poll boost when its app picks its own tab id - #7800
Conversation
…ne editor stays off the 2.5 s boost
…te echoes do not boost
There was a problem hiding this comment.
Builder reviewed your changes — looks good ✅
Review Details
Incremental Code Review Summary
This update changes own-source tracking from a refcounted registry to a tab-lifetime Set, retaining a collab connection's source after disposal so late echoes do not trigger the poll boost while another doc remains open. The new regression test exercises that late-echo case, addressing the disposal/late-event concern from the previous review. The current call sites use per-tab sources, and the Set is cleared in the test reset path; I found no confirmed runtime defects. This remains standard risk because it affects shared client sync behavior. The PR description still calls out its merge dependency on L4's flush-wake change; preserve that merge order.
Finding
- 🟡 LOW — The late-echo test does not reuse the source across docs. The closed doc and remaining doc use different request sources, so the test does not lock in the behavior for multiple open docs sharing one tab source. This is a test-coverage gap only; the current Set implementation handles it.
🧪 Browser testing: Skipped — the browser-test-planner agent is unavailable in this environment.
|
Here's a visual recap of what changed: Open the full interactive recap |

Merge order
Land this after #7832, the save-request / flush-wake fix. Until that lands, the accidental poll boost removed here helps deliver flushes to editors mid-edit. Removing it first could cause flush timeouts. It merged first anyway: this PR on October 21 at 00:05 UTC, #7832 on October 22 at 04:24 UTC.
Problem
On serverless, a lone Content or Plan editor can poll the shared sync transport every 2.5 seconds while typing. These apps tag document updates with their own tab id, while core only recognized
getBrowserTabId()as its own. The editor's updates therefore looked like another participant's activity and repeatedly armed the fast poll cadence.Fix
Core records the request sources adopted by this tab's collab connections and excludes their events from collaborator activity. Sources stay in a tab-lifetime set after a connection closes, so delayed echoes cannot re-arm the boost while another document remains open. Real peers still trigger the boost. No app code or schema changes; includes a core changeset and collab skill guidance.
Verification
5df6b4f7e1e.5df6b4f7e1ed95f68e83f793c9aafb655efe9f98.Measurement
One signed-in tab, alone on a document, typed a character every 250 ms for 120 s and then sat idle for 130 s. It ran in a local production Content build in serverless mode (
NODE_ENV=productionwithAWS_LAMBDA_FUNCTION_NAMEset), where the authenticated/events?poll_live=1returned 204. Requests were counted from the browser's network log.1d31d71a531awith this PR's two core files reverse-applied.Each cell shows before → after, as requests per minute.
Flush-request delivery latency was not measured.