Repository navigation
Publish GitHub PR status changes to every open view - #6351
Merged
ymichael merged 1 commit intoOct 27, 2026
Merged
Conversation
When a client read was the first to see a changed pull request, the store returned the new row to that read and skipped invalidating the same environment for everyone else, then marked the row as served. Other open views of that thread stayed stale until they remounted, and later polls saw no change. Any read without a plugin token counts as a client read, so `bb thread show` and `bb pull-request show` froze open views too. Publish every change to every watcher, as core did before the plugin. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/investigate-stale-github-pr-status-thr_gva967bmbe
branch
October 27, 2026 03:05
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.
Human comments
What was wrong
An open thread view could show a stale PR status indefinitely. In
plugins/github-pr-status/store.ts, when a client read was the first to fetch a changed PR,publishChangesskipped invalidating that environment, on the assumption that the reader is the only viewer. Readers were tracked by environment ID, not by client, so every other open view of the same thread was never told. The store then recorded the new row inserved, so later polls saw no change and never published either. The view stayed wrong until it remounted (switching threads does refetch) or reloaded.Any plugin RPC without a plugin token is a
clientcaller, sobb thread showandbb pull-request showcount as viewer reads. Agents and manager threads that run them froze open views of the threads they inspected. Core's implementation before #6125 (pull-request-watch.ts) published every change to every watcher. The exemption arrived with the move into the plugin and was kept in #6143.What changed
store.ts: removed the reader exemption (loadingReaders, thereadersparameter ofload, and the per-environment check inpublishChanges). Every change now invalidates every watched environment that shows it. The client that triggered the fetch refetches once more, and that read is served from the 10 s cache without callinggh.How you verified
store.test.tscase: a viewer read that finds a change must publish to the environment's watchers. It fails onmain(expected "vi.fn()" to be called once with arguments: [ [ 'a' ] ]) and passes with the change.pnpm exec turbo run test typecheck lint --filter=bb-plugin-bb--github-pr-status: 158 tests passed, typecheck and lint clean.pnpm start:worktreeinstance. A fakeghserved GraphQL PR reads from a state file, and headless pages ran against a real thread:main, B showed "Ready to merge" and A stayed on "Checks failing" for more than 6 minutes, including after the scheduled poll fetched the new state. With this change, A updated within 6 s, with oneghcall.bb thread showin the CLI. Onmain, the CLI printed passing and the page stayed failing 30 s later. With this change, it updated within 3 s.🤖 Generated with Claude Code