Skip to content

[codex] Structure empty mobile pairing payload errors#3372

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/mobile-pairing-errors
Jun 20, 2026
Merged

[codex] Structure empty mobile pairing payload errors#3372
juliusmarminge merged 1 commit into
mainfrom
codex/mobile-pairing-errors

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • replace the generic empty QR payload Error with a distinct Schema-tagged error
  • preserve the existing user-facing message
  • keep pure validation free of synthetic causes

Validation

  • pnpm vp test apps/mobile/src/features/connection/pairing.test.ts
  • pnpm vp check (20 pre-existing warnings)
  • pnpm vp run typecheck
  • pnpm vp run lint:mobile

No active open PR modifies these files.


Note

Low Risk
Localized pairing validation change with no auth or data-path impact; UI still relies on the same error message.

Overview
Empty or whitespace-only QR scan input in extractPairingUrlFromQrPayload now throws PairingQrPayloadEmptyError, a effect/Schema TaggedErrorClass, instead of a generic Error. The user-facing message is unchanged.

Tests assert both the error type and the same message string. Call sites that read error.message (e.g. the new-connection QR handler) keep the same behavior.

Reviewed by Cursor Bugbot for commit f96c917. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Replace generic Error with PairingQrPayloadEmptyError in extractPairingUrlFromQrPayload

Introduces PairingQrPayloadEmptyError, a tagged error class (via effect/Schema) in pairing.ts, replacing the generic Error thrown when an empty or whitespace-only QR payload is detected. The error message is unchanged. Tests in pairing.test.ts are updated to assert the specific error class is thrown.

Macroscope summarized f96c917.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bacfc344-6d7c-4f3c-8d3f-d27838f784ca

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/mobile-pairing-errors

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Straightforward error refactor that replaces a plain Error with a structured typed error class. No runtime behavior change - same error message thrown in the same condition, just with better type discrimination for callers.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge merged commit d87ec96 into main Jun 20, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/mobile-pairing-errors branch June 20, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant