fix(desktop): carry typed OAuth failure reasons from main-process producers - #4887
Draft
orangeCatDeveloper wants to merge 1 commit into
Draft
fix(desktop): carry typed OAuth failure reasons from main-process producers#4887orangeCatDeveloper wants to merge 1 commit into
orangeCatDeveloper wants to merge 1 commit into
Conversation
orangeCatDeveloper
force-pushed
the
fix/oauth-failure-reasons
branch
5 times, most recently
from
September 8, 2026 19:48
794d684 to
bf801eb
Compare
get-auth-url maps the Host's operation_conflict to a typed login_in_progress reason and Desktop-owned presentation failures to presentation_failed, so the renderer stops matching English prose. The did-not-present / no-matching-request regex goes away; the enrollment-disabled and already-in-progress fallbacks stay for Host versions that predate the typed codes. Generated-by: Claude Code
orangeCatDeveloper
force-pushed
the
fix/oauth-failure-reasons
branch
from
September 8, 2026 20:03
bf801eb to
c9118be
Compare
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
subscriptionResultMessagelocalized OAuth login failures by matching English Host prose with regexes. One of the three regex families —did not present OAuth|no matching OAuth presentation— described failures Desktop produces itself: the presentation timeout and the absent-request throw inruntime-host-oauth-presentation.ts. Matching your own prose is a contract you cannot see break; rewording either sentence silently drops the branch.Those producers now throw a typed
OAuthPresentationError, andget-auth-urlmaps it alongside the Host's operation codes onto the failure envelope:operation_conflict→login_in_progressOAuthPresentationError→presentation_failedoperation_unavailable→experimental_disabled(unchanged)The renderer catalog maps the two new reasons per locale and the presentation regex is deleted. The
enrollment is disabledandalready in progressprose fallbacks stay: the first covers Hosts older than these codes, and the second still has a live producer inpresentation.expect, which throws a plain error. The ad-hocloginConflict/browserPresentFailedkeys fold intoresultCodeswith the same wording.Refs #2672
Verification
Not run: Electron e2e against a live Host login flow.
AI use
Tool(s) and scope: Claude Code — traced the producer→presenter path, implemented the typed error and reason mapping, removed the regex, added the tests, and wrote this description.
Checklist
Does this PR entail a change in behavior?