You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): a PR whose merge is refused for conflicts shows as conflicting - #41500
When another PR merges first and conflicts with this one, clicking Merge fails with "Could not merge this pull request — GitHub returned an error: Pull Request has merge conflicts". The toast appears, but the PR detail panel and the thread sidebar row still show the old mergeable state and a Merge button. They should show the PR as blocked by conflicts, the same as a PR the host already reports as conflicting.
Repro: open two PRs that edit the same lines, merge one on GitHub, then click Merge on the other in T3 Code. The sidebar row stays wrong until its 10-minute poll.
Change
runActionAndInvalidate already clears the PR's read cache when an action fails. It only bumps the PR's epoch and notifies subscribeRefreshes readers on success, so open clients never re-read. A failed action now notifies readers too, which rerunChecks already does after a failure:
Every PR query in client-runtime uses subscribeRefreshes as its refresh trigger. The detail panel, the sidebar row, and the lists on web, desktop, and mobile therefore re-read the PR and show its conflict state with no client change. Any refused action (close, update-branch, …) now refreshes the same way. The cost is one extra re-read after a failed action, the same as after a successful one.
Scope
Small fix for an obvious bug, so there is no issue: a host refusal leaves every client showing state the host has just contradicted. I found it as a daily user. Open PRs that touch merge state (#25803, #28841, #37641) do not cover this path.
Verification
New test in PullRequestService.test.ts, "a refused merge notifies readers so they re-read the conflicting state":
summary(pr) -> mergeability: "mergeable"
subscribe to refreshes
runAction(merge) -> host refuses: "Pull Request has merge conflicts"
on the next refresh, summary(pr) -> mergeability: "conflicting"
Before: the test times out after 120 s because no refresh is published after the refused merge.
After: it passes, along with all 131 tests in the file. vp run check:changed passes (format, lint, graphql, knip, typecheck, tests).
I did not check this in a running app against a live conflicting PR. There is no UI code change: clients re-read and render the conflict state they already support.
Written by Claude Opus 5.5 (claude-opus-5-5) in Claude Code, running in T3 Code.
Reviewing files that changed from the base of the PR and between dae2192 and 8fd95ee.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
When a pull request action fails, the service now updates reference and listing epochs and notifies refresh subscribers. A regression test verifies that a subscribed reader can observe a conflicting merge state after the provider rejects the merge.
Changes: Failed action refresh
Layer / File(s)
Summary
Failed action refresh and regression test apps/server/src/pullRequest/PullRequestService.ts, apps/server/src/pullRequest/PullRequestService.test.ts
Failed actions now update reference and listing epochs and notify refresh subscribers. The regression test verifies that a subscribed summary read observes the conflicting state after a failed merge.
pingdotgg/t3code#32842: Changes the client display after a refused merge; this PR changes the server refresh behavior after a failed action.
Suggested reviewers:juliusmarminge, sidreyas
Merge Risk: Minimal · previous review dae21
Failed pull request actions now trigger a re-read, so a refused merge shows the conflicting state instead of a stale Merge button. The cost is one extra read after a failure. No actionable merge risk remains.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the actual change: a refused merge for conflicts now updates the PR's displayed state. The raw summary confirms that runActionAndInvalidate now bumps epochs and notifies refresh subscr…
Description check
The description follows the repository template. It has Problem, Change, Scope, and Verification sections. The Problem section states the expected behavior and gives repro steps. The Change section ex…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the actual change: a refused merge for conflicts now updates the PR's displayed state. The raw summary confirms that runActionAndInvalidate now bumps epochs and notifies refresh subscribers on failure, and the PR objectives describe the same fix. The title is a conventional commit in plain language and is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description follows the repository template. It has Problem, Change, Scope, and Verification sections. The Problem section states the expected behavior and gives repro steps. The Change section explains the fix and why no client change is needed. The Scope section explains why no issue is linked and cites related PRs. The Verification section lists a focused test with before and after results, names the checks run, and says what was not tested (a live conflicting PR in a running app). The model and harness are listed at the end, as the template asks.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Created two real GitLab merge requests editing the same line. Opened the second in T3, merged the first through GitLab's API, confirmed the second had conflicts, then clicked Merge → Confirm merge? in T3. Captures show the settled state 30 seconds after refusal, without reloading. Both runs used fresh databases, light theme, and a 1280×800 web viewport.
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
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedAuthor is not yet trusted in the VOUCHED list.
2 participants
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.
Problem
When another PR merges first and conflicts with this one, clicking Merge fails with "Could not merge this pull request — GitHub returned an error: Pull Request has merge conflicts". The toast appears, but the PR detail panel and the thread sidebar row still show the old mergeable state and a Merge button. They should show the PR as blocked by conflicts, the same as a PR the host already reports as conflicting.
Repro: open two PRs that edit the same lines, merge one on GitHub, then click Merge on the other in T3 Code. The sidebar row stays wrong until its 10-minute poll.
Change
runActionAndInvalidatealready clears the PR's read cache when an action fails. It only bumps the PR's epoch and notifiessubscribeRefreshesreaders on success, so open clients never re-read. A failed action now notifies readers too, whichrerunChecksalready does after a failure:runActionAndInvalidate(input) invalidate read cache runAction(input) ensuring: invalidate read cache + on failure: bump ref epoch, bump listings epoch, notify refresh subscribers on success: bump ref epoch, bump listings epoch, notify refresh subscribersEvery PR query in
client-runtimeusessubscribeRefreshesas its refresh trigger. The detail panel, the sidebar row, and the lists on web, desktop, and mobile therefore re-read the PR and show its conflict state with no client change. Any refused action (close, update-branch, …) now refreshes the same way. The cost is one extra re-read after a failed action, the same as after a successful one.Scope
Small fix for an obvious bug, so there is no issue: a host refusal leaves every client showing state the host has just contradicted. I found it as a daily user. Open PRs that touch merge state (#25803, #28841, #37641) do not cover this path.
Verification
New test in
PullRequestService.test.ts, "a refused merge notifies readers so they re-read the conflicting state":vp run check:changedpasses (format, lint, graphql, knip, typecheck, tests).I did not check this in a running app against a live conflicting PR. There is no UI code change: clients re-read and render the conflict state they already support.
Written by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, running in T3 Code.