Repository navigation
feat(mobile): surface pairing-auth failures on desktop and mobile - #9782
Conversation
…f silent 4001 loops Desktop: when a phone repeatedly fails direct-transport E2EE auth with a token missing from the device registry (pre-v1.4.106 pairing-path bug left desktops that regenerated their registry rejecting paired phones forever), throttle to one notification per session and show an actionable toast pointing at Settings -> Mobile to re-pair. Mobile: map a bare 4001 close onto the existing auth retry budget (the encrypted e2ee_error is undecryptable when the desktop keypair changed, so the close code is the only surviving signal) instead of looping the generic reconnect forever, and make the auth-failed verdict say 'Pairing invalid - re-pair with your desktop' instead of a bare 'Auth failed'.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThe PR adds unauthorized E2EE authentication handling for stale or invalid pairing credentials, including WebSocket close code 4001 and mobile auth-failure state labeling. Direct transport failures are throttled before notification. Main-process IPC and preload APIs support pending and live failure notifications. Renderer code consumes these notifications and displays localized re-pairing guidance with a Mobile Settings action. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…air-auth-surface # Conflicts: # src/main/runtime/runtime-rpc.ts
QA screenshotsTested the PR branch on the isolated Electron app and an iPhone 17 Pro simulator. Scenario: a saved mobile host with stale pairing credentials connected to the current desktop. Three real WebSocket Desktop authentication warningThe Open Mobile Settings action navigated to Settings → Mobile: Mobile authentication failureThe host detail exposes the complete recovery guidance and Retry, Re-pair, and Remove actions: Platform scope: iOS was captured; Android was not separately exercised. No repository files were changed for this QA pass. |
…ablyai#9782) * feat(mobile-pairing): surface unpaired-device auth failures instead of silent 4001 loops Desktop: when a phone repeatedly fails direct-transport E2EE auth with a token missing from the device registry (pre-v1.4.106 pairing-path bug left desktops that regenerated their registry rejecting paired phones forever), throttle to one notification per session and show an actionable toast pointing at Settings -> Mobile to re-pair. Mobile: map a bare 4001 close onto the existing auth retry budget (the encrypted e2ee_error is undecryptable when the desktop keypair changed, so the close code is the only surviving signal) instead of looping the generic reconnect forever, and make the auth-failed verdict say 'Pairing invalid - re-pair with your desktop' instead of a bare 'Auth failed'. * fix(mobile-pairing): handle stale keys and startup notification races * fix(mobile-pairing): isolate auth notification failures * fix(mobile-pairing): keep recovery alert actionable




Part of the mobile version-skew incident response: desktops that hit the pre-v1.4.106 pairing-path bug lost their E2EE keypair / device registry, so previously-paired phones fail auth forever with 4001 Unauthorized — and both ends stay silent (desktop drops the connection, phone loops the generic reconnect).
Desktop
UnpairedDeviceAuthThrottle(src/main/runtime/rpc/unpaired-device-auth-throttle.ts): 3 unpaired direct-transport auth failures within 60s fire a single notification per runtime session. Relay attempts are excluded because they are authorized upstream.orca serveretains at most one pending boolean and performs no polling or renderer work.Mobile
AUTH_RETRY_BUDGETinrpc-client.tsinstead of feeding the endless generic reconnect loop. This matters when the encryptede2ee_erroris lost or undecryptable and the close code is the only surviving auth-failure signal. Three strikes (shared budget with decryptede2ee_errorrejections) latchauth-failed, which the host-detail screen already surfaces with Retry / Re-pair / Remove actions.auth-failedverdict label is now “Pairing invalid — re-pair with your desktop” (host card / status dot) and “Pairing invalid” in session route labels, instead of a generic “Auth failed”.Tests
unpaired-device-auth-throttle.test.ts).e2ee_error, and non-4001 keeps generic retry.Follow-up
auth-failedon the first decryptede2ee_error(no 3-retry budget), so behavior differs between direct and relay transports — worth unifying.Note: two pre-existing lint failures on the base branch (
skill-freshness-group.tsxswitch-exhaustiveness, AI Vault localization coverage) are unrelated to this change.