Skip to content

Keep a known PR badge when its machine is briefly unreachable - #6864

Merged
ymichael merged 1 commit into
mainfrom
bb/fix-sidebar-display-issue-thr_hpi7edyeex
Nov 2, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fix-sidebar-display-issue-thr_hpi7edyeex

Conversation

@ymichael

@ymichael ymichael commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

After a server restart, the GitHub PR Status plugin restores each environment's PR from its database and serves it right away. It also starts a background re-check right away, often before the host daemon has reconnected. That re-check returned unavailable ("machine isn't available"), and store.load replaced the environment's known PR link with that result. The sidebar row badge disappeared and stayed gone until something re-read that row, such as opening the thread or refocusing the page. Observed on prod: the server restarted at 13:04:14 and the daemon reconnected at 13:04:20. Afterwards the sidebar showed only #6849 (the thread that was opened). Six other inbox threads with open PRs (#6760, #6755, #6736, #6728, #6727, #6734) showed no badge, although their links and snapshots were still in the plugin database.

What changed

  • plugins/github-pr-status/store.ts: when a re-check of a known PR URL comes back unavailable, the environment's link is no longer replaced, so the last snapshot keeps being served. The snapshot's fetchedAt is still bumped, so the regular poll retries it. Discovery reads (no known URL) behave as before.
  • Behaviour change: bb pull-request show for an environment whose machine is offline now prints the last PR bb saw, or unavailable when it has none. Actions (ready/draft/merge) still refuse with the machine message. The skill doc and README are updated.

How you verified

  • New store test, "keeps serving a restored PR when its machine is unreachable after a restart": it restores a persisted PR, makes the first re-check return unavailable, and checks that the PR is still served, nothing is published, and the next successful check publishes the update. It fails without the fix (expected { outcome: 'unavailable' } to deeply equal { outcome: 'available' }) and passes with it.
  • pnpm exec turbo run test typecheck lint --filter=bb-plugin-bb--github-pr-status: 183/183 tests pass, typecheck and lint clean.

AGENT GENERATED

🤖 Generated with Claude Code

After a server restart, sidebar reads re-check every restored PR before
the host daemon reconnects. Each check came back "unavailable" and
replaced the environment's known PR link, so the row badge disappeared
until that thread was opened or the page refocused. A transient
unavailable result for a known PR now leaves the last snapshot in place.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ymichael
ymichael merged commit a518185 into main Nov 2, 2026
48 checks passed
@ymichael
ymichael deleted the bb/fix-sidebar-display-issue-thr_hpi7edyeex branch November 2, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant