Repository navigation
fix(devices): unpairing on the phone revokes it on the Host - #2412
Conversation
Issue: #2409 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmBSdCWaDy5fcVKc4vm7gn
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
iOS Simulator acceptance at 43151d8 (iOS 27, dev client; QA Host restarted from this branch). Steps 1–3 pass. Screenshots are on
AX5 finding: the notice is a native alert. At the largest text size, the body is cut off at "On that computer," and the Done button sits half outside the alert. A shorter body or a sheet would fit better. Step 4 (over Tailscale): not run. The QA Host has no Tailscale route, and adding one would change the Mac's persistent Cleanup: all test pairings on the QA Host are revoked. 0 active devices. Generated by Claude Code |
…ground Acceptance found a 7 s pause after confirming Unpair while the phone waited on the Host, and the offline notice clipped at the largest text size. The phone now forgets the Host immediately, revokes afterwards, and shows a shorter notice only if the Host could not be reached. Issue: #2409 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmBSdCWaDy5fcVKc4vm7gn
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
iOS recheck at c88c74b (iOS 27, dev client; QA Host restarted from this head). Screenshots are on
Cleanup: all QA devices are revoked on the Host, with 0 active. Step 4 (unpair over Tailscale) runs next, with the #2397 device check. Generated by Claude Code |
…paired Issue: #2409 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmBSdCWaDy5fcVKc4vm7gn
|
iOS Simulator recheck at d4c7745: the drawer passes, but there is a regression. The Host ran on this branch, and the dev client had one paired computer.
Likely cause, inferred: the background revoke's 401 Generated by Claude Code |
Revoking first could close the phone's live connection before the local removal landed, leaving the phone on the old computer's chats under a 'refused' banner. The phone now drops the computer, then unregisters push and revokes in the background. Issue: #2409 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PmBSdCWaDy5fcVKc4vm7gn
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
iOS 27 Simulator recheck at 687e7cd: both steps pass. The Host ran on this branch, and the dev client had one paired computer.
Not caused by this PR: the "Pair with your computer" title sits faded under the status bar. That's the title bug fixed in #2402. Generated by Claude Code |
…-hyen2f # Conflicts: # apps/mobile/src/host/host-session.ts










Why the change
Unpair in the mobile app only forgot the Host on the phone, so the pairing stayed active on the Host. With hosted Connect, the gateway is reachable from the internet, so a pairing the person thinks is gone kept working.
Issue / Discussion: Closes #2409
Special things to note
POST /botharness-device/unpair. It needs the device's ownDevicecredential and revokes only that device, using the existingpairing.revoke, which also closes its open streams.404. The phone treats that as "Host kept" and shows the notice.401 device-revokedordevice-unknowncount as revoked.device-gateway.test.tscovers three cases: a missing credential gets 401; a device can revoke itself and is refused afterwards; another device is untouched.apps/mobilesuite passes.tsc --noEmitpasses for the repo root and forapps/mobile.revokedAtwithin about 1 s. The old credential gets401 device-revoked.Change outline
packages/core/src/devices/gateway.ts:DEVICE_UNPAIR_PATHand its handler.apps/mobile/src/host/pairing.ts:revokePairing({ host, carrier })returns'revoked' | 'unreachable'.apps/mobile/src/host/host-session.ts:unpair()forgets locally, then returns{ revoked: Promise<boolean> }for the background push unregister and Host revoke.apps/mobile/src/ui/unpair-notice.ts: the notice, used from the drawer and from Settings.apps/mobile/src/ui/shell/host-drawer.tsx: closes the drawer when the last computer is unpaired.apps/mobile/src/ui/strings.ts: en and zh copy.changes/2409-unpair-revokes-host.md🤖 Generated with Claude Code
https://claude.ai/code/session_01PmBSdCWaDy5fcVKc4vm7gn
Summary by CodeRabbit
New Features
Documentation