fix(web): pull request panel polls go around the server hold - #9829
fix(web): pull request panel polls go around the server hold#9829lnieuwenhuis wants to merge 4 commits into
Conversation
The panel's automatic refresh (five-minute interval and return-to-window read) now invalidates the pull request on the server before re-reading its detail, the same way the manual Refresh action already does. An ordinary detail read is answered from the server's hold while it refreshes behind the answer, so each poll showed the previous poll's data and a passively watched panel never caught an external title or check change. The invalidation is scoped to that one pull request (bumpRefEpoch).
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d878b13. Configure here.
ApprovabilityVerdict: Would Approve Macroscope's review found this PR approvable — The change narrowly fixes stale pull-request metadata polling by invalidating only detail data, while preserving cached diff pages and existing full-refresh behavior. The additive contract change and targeted server regression tests keep the runtime impact bounded. Not approved because:
Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more. |

The PR detail poll re-reads through the server hold, so external title and check changes stay invisible until the hold expires.
Invalidate only the detail reference before each polled re-read, preserving cached diff pages even while metadata refresh is pending or fails. When the PR revision changes, await full invalidation before refreshing activity and diff data. Regressions cover held metadata, immediate and failed-refresh diff reads, both cached pages, and full invalidation; polling cadence is unchanged.
Ports #9491 with the requested regression coverage.
Built with muse-spark-1.3-contributor via OpenCode in T3 Code.
Note
Medium Risk
Touches PR caching and invalidation semantics on the server and poll path in the UI; wrong scoping could cause stale UI or extra host requests, but behavior is covered by new tests.
Overview
PR panel polls were re-reading detail through the server’s stale-while-revalidate hold, so title and check updates from the host never showed until the hold expired.
The panel now invalidates with
scope: "detail"before each live refresh, so the next detail read misses the hold and fetches fresh metadata. Manual refresh still invalidates detail and diff (unchanged behavior).On the server, detail and diff use separate cache epochs:
invalidate({ scope: "detail" })only strands the detail/summary path; diff keeps its SWR hold so the Code tab is not forced to refetch on every poll. Contracts add optionalscope:"detail"|"all"``.Regression tests cover invalidated vs plain re-read under an in-flight background refresh, and detail-scoped invalidate without stranding a held diff.
Reviewed by Cursor Bugbot for commit 103ffcd. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Route PR panel live polls through detail-scoped server invalidation
PullRequestInvalidateInputwith an optionalscopeofdetailorallin pullRequest.tsscope: "all"(or omit the field) to invalidate both detail and diff; detail-only invalidation intentionally leaves diff staleMacroscope summarized 103ffcd.