Repository navigation
Conversation
… propagation
When GitHub's API hasn't propagated the new headSha within the 2.5s
post-push delay, the existing flow skipped the checks refresh (fetchChecks
callback reference unchanged → poller didn't restart → stale CI results for
up to 120s with exponential backoff). Two-pronged fix:
1. refreshGitHubForWorktree now invalidates the checksCache entries for the
current PR (both headSha-keyed and legacy keys), so any subsequent fetch
bypasses the 60s TTL even when headSha hasn't changed yet.
2. A checksPostPushNonceByWorktree counter is bumped on every
refreshGitHubForWorktree call. ChecksPanel subscribes to it and immediately
calls fetchChecks({ force: true }) + resets exponential backoff whenever
the nonce increments while the panel is visible.
Closes stablyai#2832
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Contributor
|
Coordinator evidence update: I took over this PR under the current non-team and newer-than-2026-05-01 scope. The fix direction is valid, but the PR needed one more race hardening pass. Pushed follow-up commit Evidence:
Residual validation gap: GitHub currently reports no status checks for head |
This branch has not been deployed
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.
Summary
refreshGitHubForWorktree(called after push) re-fetches the PR. If GitHub's API returns the sameheadShawithin the 2.5sPOST_PUSH_DELAY_MS, thefetchChecksuseCallback reference doesn't change → the polling effect doesn't restart → stale CI checks remain for up to 120s (exponential backoff max).refreshGitHubForWorktreenow setsfetchedAt: 0on both the headSha-keyed and legacy checks cache entries for the current PR, so any subsequentfetchPRCheckscall bypasses the 60s TTL regardless of whether the PR headSha has propagated.checksPostPushNonceByWorktreeto the store. The nonce is bumped inrefreshGitHubForWorktree.ChecksPanelsubscribes to it and callsfetchChecks({ force: true })+ resets exponential backoff immediately when the panel is visible.Test plan
Closes #2832
🤖 Generated with Claude Code
Risk assessment
Risk: MEDIUM
Historic risk metadata backfill based on the existing
risk:mediumlabel.Risk: medium
Historic risk metadata backfill based on the existing
risk:mediumlabel.ELI5
After push, CI checks could stay stale up to two minutes if GitHub still reported the old commit SHA. Checks cache is force-invalidated so fresh status loads.