Repository navigation
fix(mobile-quick-commands): replay sheet load killed by connection migration - #9798
Conversation
…gration Opening the Quick Commands sheet right after connecting over relay races the relay->direct cutover, which rejects the in-flight one-shot settings.getTerminalQuickCommands with LogicalClientCutoverError while connState stays 'connected'. The sheet then strands on "RPC interrupted by connection migration" with an empty list until closed and reopened. The read is side-effect-free, so replay it on cutover (capped at 5, cancelled if the sheet closes or the client is replaced). Same failure class and pattern as #9794 (capability probe) and #9796 (terminal create).
|
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 (2)
📝 WalkthroughWalkthroughQuick-command loading now retries logical-client cutover errors up to five times while checking whether the operation was cancelled. The loading effect uses this retry helper while preserving existing validity checks. Tests cover successful replay, exhausted retries, non-cutover failures, and stopping retries when the feature is disabled. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
…k-commands-sheet-cutover # Conflicts: # mobile/src/transport/stable-logical-rpc-client.ts
|
Manual QA after merging current
Desktop source state: Mobile result: |
…gration (stablyai#9798) Opening the Quick Commands sheet right after connecting over relay races the relay->direct cutover, which rejects the in-flight one-shot settings.getTerminalQuickCommands with LogicalClientCutoverError while connState stays 'connected'. The sheet then strands on "RPC interrupted by connection migration" with an empty list until closed and reopened. The read is side-effect-free, so replay it on cutover (capped at 5, cancelled if the sheet closes or the client is replaced). Same failure class and pattern as stablyai#9794 (capability probe) and stablyai#9796 (terminal create).


Problem
Opening the Quick Commands sheet within a few seconds of connecting over relay races the relay→direct cutover. The cutover (
migrateToinstable-logical-rpc-client.ts) rejects the sheet's in-flight one-shotsettings.getTerminalQuickCommandswithLogicalClientCutoverErrorwhileconnStatestays'connected', so nothing re-triggers the fetch. The sheet strands on a red "RPC interrupted by connection migration" error with a misleading empty "No quick commands yet" list until closed and reopened.Hit live on 2026-07-21 (screenshot on file). Third surface of the same cutover-kill mechanism as #9794 (capability probe → button vanishes) and #9796 (terminal create → "Couldn't run …" toast); neither of those touches this fetch.
Fix
use-quick-commands.ts: wrap the load inloadQuickCommandsWithCutoverRetry— the read is side-effect-free, so it replays immediately on cutover (the replacement session is already authenticated), capped at 5 replays, and aborts if the sheet closes / the operation is superseded / the client is replaced. Mirrors the on-main pattern inworktree-create-capability.ts.stable-logical-rpc-client.ts: exportisLogicalClientCutoverError. Byte-identical to the export added in fix(mobile): retry session capability probe so tab-row actions survive relay cutover #9794 and fix(mobile): replay terminal creates killed by transport cutover #9796 — whichever lands second/third gets a trivial same-code conflict; keep either side.Non-cutover failures (timeouts,
ok:false) still surface immediately — unchanged behavior, kept out of scope.Verification
src/session+src/transportsuites: 134 files, 867 passed / 2 skipped.tsc --noEmit,oxlint,oxfmt --checkall clean.