You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(client): batch large thread sync updates (upstream pingdotgg#5344) (#328)
Imported from pingdotgg#5344 at source SHA
783fd02 (commits b623dc2 + 783fd02
squashed into one provenance commit).
Imported behavior:
- `reduceThreadStreamItems`, a pure reducer that folds a batch of thread
stream items into one state and one persistable snapshot.
- `Stream.groupedWithin(64, 16ms)` on the live subscription so a burst of
thread events publishes the `SubscriptionRef` once instead of per event,
and web/mobile stop rebuilding large thread views per streamed event.
- `eventBatchSize` on `EnvironmentThreadStateOptions`, plus the upstream
regression tests for ordered single-publication bursts and for persisting
a settled snapshot when a batch ends with a non-persistable turn start.
Local adaptations:
- Kept our `httpSnapshotLoadAttempted` guard around the HTTP snapshot
fallback; the call now goes through `applyItems([...])`.
- Restored `setDeleted` (removed upstream) for the terminal
`thread-deleted` subscription failure, which never reaches the item
stream and so cannot go through the batch reducer. Cache removal is
shared with the reducer path via `removeCachedThread`.
Excluded:
- `tasks/todo.md`, the author's scratch checklist.
Follow-up (fork/changes, not this layer): our `reload-required` branch and
`reloadFromServer` are built on the deleted `setThread`, so rebasing
fork/changes onto this layer must re-express them against the reducer
(split the batch at the reload point, then re-enter `applyItems` with the
remainder).
Co-authored-by: T3 Code PR Stack <41898282+github-actions[bot]@users.noreply.github.com>
0 commit comments