Repository navigation
perf(gateway): reduce redundant live overview updates - #1039
Merged
Merged
Conversation
nixuuu
marked this pull request as ready for review
November 19, 2026 18:32
nixuuu
enabled auto-merge (squash)
November 19, 2026 18:33
This was referenced Nov 19, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 24, 2026
## Change - Publish the updated thread overview after individual or batched background refreshes of linked pull requests. The sidebar and Thread details now show the same PR state once the gateway detects a merge. - Reconcile a previously cached status on list reads, including an already-merged PR. Reconciliation uses the existing cache and publication path. Fixes: #1039 ## Verification - Reproduced the missing overview update before the fix in three gRPC regression cases covering single refresh, batched refresh, and an already-cached merge. - Ran 24 integration tests through `check:tmp`, the gateway typecheck, and lint on edited files. An existing account-switch test failed once, then passed in isolation and in the final 24-test run. - Verified in desktop-width Chromium with an isolated gateway that Thread details and the sidebar switched from Open to Merged without a reload. - Repository-wide checks remain with CI.
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.
Change
A cached pull request read could publish thread and overview updates for every linked thread in its repository. Selecting another active thread could also restart the shared overview twice and fetch two full snapshots. A slow overview subscriber could then reach its 256-frame limit while little data was queued.
Migration 0177 initializes a per-link summary fingerprint for current active links. It keeps concurrent readers of the same PR from increasing a thread’s list revision repeatedly.
Verification
An isolated repository with 439 linked threads, including five linked to the measured PR, reproduced the fan-out. One warm GetPullRequest made 439 projection calls, read 439 thread rows and produced 878 hub publications before the change. Each count fell to zero, with the same PR returned and no GitHub HTTP request in either run. One local RPC took 247.7 ms before and 6.7 ms after.
On the original gateway a two-thread burst of 300 worker events terminated the stalled overview with DataLoss. The fixed gateway delivered both final states, persisted all 300 events in order and replayed both completed responses from pre-burst checkpoints. Separate cases exercise item and byte overflow with nonreplaceable frames, and delivery to a healthy observer.
Five renderer handovers with the same subscriptions produced ten additional snapshots before and zero after. Real PostgreSQL and gRPC integration coverage exercises independent PRs in the same repository, shared links, concurrent unlink, older PRs, cache repair, account changes, bot feeds, disconnection, worker replay and lost acknowledgements.
With five projects and 16 status reports, the original gateway published 80 project frames. The fixed gateway published zero, issued zero project list queries and delivered all 16 worker updates. The same suite verifies changed Git origins, retry after a failed read and a new worker’s scratch placement.
Production renderer in Chromium, isolated gateway, BFF and PostgreSQL. Seven bot conversation switches opened no additional overview SSE. A pending approval survived navigation and reload and sent exactly one worker response. Checked light and dark at desktop and phone widths.
Fixes: #501
Fixes: #847
Fixes: #458