Repository navigation
fix(mobile): name the connected provider in PR review reconnect errors - #8476
Conversation
The reconnect copy selected for every PR-review mutation failure now names the provider of the surface it appears on: GitHub keeps prReview.connectionExpired, while the GitLab and Bitbucket arms reuse the reconnect notice's own provider titles, so the status line and the notice agree. The selection moves into reconnectExpiredMessage() plus an optional platform on mutationErrorDisplay. useComposerInlineError reads the provider scope the pr-review routes publish, and the merge sheet, the review-submit sheet, the reply input and the conversation composer pass the platform they already hold.
|
bot: Android proof of the provider-aware reconnect copy, captured on a GitLab merge request opened from a fixture integration on the local dev stack (fixture account, fixture repository, fixture merge request). Flow: opened the merge request's merge sheet, then submitted the merge while the provider call answered with an authorization failure.
Both captures are the same merge sheet frame; only the provider name in the status line differs. |
…pr-reconnect-copy
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe provider-aware reconnect copy is selected consistently on every PR-review surface, reuses existing translated keys present in all 87 catalogs, and preserves the GitHub bytes for the GitHub and platform-less arms. Assumptions: Overview
Files Reviewed (10 files)
Reviewed by deepseek-flash-latest · Input: 99.5K · Output: 21.8K · Cached: 2.2M Review guidance: REVIEW.md from base branch |
|
bot: Android proof of the provider-aware reconnect copy, captured against the real local routers on this branch's head. Setup: local dev stack (Next.js, Postgres, tRPC) with GitLab served by one local stub at the network boundary (reads, project settings, approvals, credential broker), Android emulator signed in with an owned fixture account in a fixture organization that owns the fixture GitLab integration, on a fixture merge request. Trigger exercised: the fixture account's organization membership is removed while the provider-review screen is open, so the app's next provider write reaches the real router, where the organization access guard rejects it before any GitLab request is sent. The stub log shows reads and broker calls only — no GitLab write. That rejection is what the app classifies as a reconnect and repaints here. Observed (each capture is the sheet after the rejected mutation):
Limitations: the Bitbucket arm shares the same selection helper and the review-submit sheet uses the same display helper with the provider term; both are covered by the unit tests, not by this emulator run. The run does not prove GitLab accepts a real request — it proves the client copy on the app's own rejection path, which is what this change selects. |





What
PR-review reconnect messages now name the provider of the surface they appear on.
lib/pr-review/mutation-error-display.tsgainsreconnectExpiredMessage(platform)and an optionalplatformoption. The reconnect kind selectsprReview.connectionExpiredon GitHub and thereconnect notice's own
prReview.reconnectNotice.gitlabTitle/bitbucketTitleon GitLab andBitbucket, so the status line and the notice beside it agree.
useComposerInlineErrorreads the provider scope the pr-review routes publish, which covers theinline comment composer and its edit sheet without threading a new prop through their routes.
platform they already hold (
prRef.platform/provider.platform).No new catalog keys: the provider titles already exist in all 87 locales, and
connectionExpiredremains the GitHub copy, so
check:i18nandcheck:pluralsare unchanged.Tests
mutation-error-display.test.ts: the reconnect kind for no platform,github,gitlabandbitbucket.pr-merge-sheet.test.tsx: a GitLab and a Bitbucket reconnect error write the provider's statustext, and the GitHub arm keeps the GitHub copy.
composer-inline-error.test.tsx: the composer hook under a GitLab provider scope selects theGitLab copy.
path is covered by the composer hook suite.
Run on this VM: full
pnpm --filter kilo-app test,tsgo --noEmit, mobilelint, andcheck:i18n/check:plurals.End-to-end evidence
Local dev stack on this VM — real Next.js, Postgres and tRPC routers — with GitLab faked at its
network boundary by one local stub (merge-request reads, project settings, approvals, and the
credential broker). Android emulator, dev client, signed in with an owned fixture account in a
fixture organization that owns the fixture GitLab integration, on a fixture merge request. No
product code was changed to produce the failure.
Trigger exercised on the device: the fixture account's organization membership is removed while the
provider-review screen is open. The app's next provider write reaches the real router, and
ensureOrganizationAccessrejects it withUNAUTHORIZEDbefore any GitLab request is sent — thestub log for the whole run contains reads and broker calls only, no GitLab write. That is the
classification
classifyPrReviewMutationErrormaps toreconnect, the branch this change repaints.Observed at head
0bcd2f80:providerReview.mergePullRequestanswered 401. The status line and the notice titleboth read "GitLab connection expired", above the GitLab connection notice body and its Check
connection control.
providerReview.replyToCommentanswered 401. The inline error reads"GitLab connection expired" above the same notice.
providerReview.addCommentanswered 401. The inline error reads"GitLab connection expired".
Screenshots of all three states are attached in a follow-up comment on this pull request.
Already run on this VM:
vitestfor the four touched suites (66 tests),pnpm --filter kilo-app check:i18n(87 catalogs) andcheck:plurals.Limitations
reconnectExpiredMessageand is covered by the unit test, not by anemulator run.
real request, which this copy selection does not depend on.
Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: Reuse reconnectNotice.gitlabTitle / bitbucketTitle
Confidence: 0.75 · Precedent: Speed and least work: "do the least amount of work possible, with no drop in quality" (session 7f3470e0ba6f). Every catalog already holds correct translations, and the status line and the notice stay consistent.
Answer: Keep, fix its wording
Confidence: 0.55 · Precedent: Keep similar elements consistent across surfaces (session a247f3c19b1e, thought row to match tool call row). Dropping the line only on the provider arms would make the arms diverge and lose the live-region announcement. The redundant copy applies to all three arms and is outside this item's scope.
Answer: Keep connectionExpired (brief)
Confidence: 0.70 · Precedent: Speed and least work: "skip work that doesn't need to be done" (session 00eb2a1d3e4b). The brief says GitHub keeps prReview.connectionExpired.
Answer: Fake GitLab + broker, before/after
Confidence: 0.75 · Precedent: Proof and verification: "only bug reports technically need to care about repro" (session 7f3470e0ba6f). This item is a wrong-provider bug, so it needs proof of the base reproduction and of the fix.
Answer: Merge main into the branch
Confidence: 0.90 · Precedent: Git and pull requests: merge main only when a conflict or a fix on main needs it — session a247f3c19b1e, "try merging main in, that may fix the issue"; also "blocked is not an acceptable end state" (55c9c80332a7).