Skip to content

fix(mobile-quick-commands): replay sheet load killed by connection migration - #9798

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/fix-quick-commands-sheet-cutover
Jul 22, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/fix-quick-commands-sheet-cutover

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Problem

Opening the Quick Commands sheet within a few seconds of connecting over relay races the relay→direct cutover. The cutover (migrateTo in stable-logical-rpc-client.ts) rejects the sheet's in-flight one-shot settings.getTerminalQuickCommands with LogicalClientCutoverError while connState stays '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

Non-cutover failures (timeouts, ok:false) still surface immediately — unchanged behavior, kept out of scope.

Verification

  • 4 new tests: replay-then-succeed, exhaustion after 6 attempts surfaces the error, non-cutover errors not replayed, no replay after the sheet closes.
  • Mobile src/session + src/transport suites: 134 files, 867 passed / 2 skipped.
  • tsc --noEmit, oxlint, oxfmt --check all clean.

…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).
@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 75cbec20-3e69-496d-93de-55db13c81cb3

📥 Commits

Reviewing files that changed from the base of the PR and between 44f77a3 and 516ef3c.

📒 Files selected for processing (2)
  • mobile/src/session/use-quick-commands.test.ts
  • mobile/src/session/use-quick-commands.ts

📝 Walkthrough

Walkthrough

Quick-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)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing the required template sections for screenshots, testing checklist, AI review report, security audit, and notes. Rewrite the PR description using the repository template and add all required sections, especially screenshots, testing checklist, AI review report, security audit, and notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: retrying the quick commands sheet load during connection migration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

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

…k-commands-sheet-cutover

# Conflicts:
#	mobile/src/transport/stable-logical-rpc-client.ts
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Manual QA after merging current main:

  • Launched the Electron dev build from this exact worktree and verified its runtime identity over CDP.
  • Added a real global PR 9798 QA command through Desktop Settings → Quick Commands.
  • Loaded this branch in Orca Mobile on an iPhone 17 Pro simulator (iOS 26.5), paired it to that dev runtime over LAN, opened the live main terminal, and tapped the real Quick Commands control.
  • The sheet loaded the saved command with no red migration error or stranded empty state. Metro reported a successful bundle and no redbox.
  • Exact relay→direct cutover replay is covered deterministically by the hook and stable-client tests; relay was unavailable in this dev build, so the manual run used direct LAN.

Desktop source state:

Desktop Quick Commands

Mobile result:

Mobile Quick Commands sheet

@brennanb2025
brennanb2025 merged commit dfbc2e8 into main Jul 22, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant