Skip to content

fix(mobile): save drafts to the phone while the desktop is offline - #39464

Merged
AmoabaKelvin merged 1 commit into
mainfrom
save-store-rows-before-verdict
Nov 7, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
save-store-rows-before-verdict

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

The phone app keeps chat drafts and queued messages in its own encrypted store, so they survive Orca being closed. But while the desktop was unreachable, the app held every save back until the desktop came back. Close Orca during that time and the save never happened. Now saves to the phone's own store go through at once, desktop or not.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​15
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​3

What Changed

  • Before: the shell holds every page request until the connection's verdict opens (perf(mobile): render the cached page build first and talk only after the connection's verdict #39174), except a short list of phone-only native verbs. native.store.rows, the page's device-store verb, wasn't on that list. A draft typed or a message queued while the desktop was out sat in the bridge until the phone reconnected, and was lost if Orca closed first.
  • After: native.store.rows is on the phone-only list in bridge-host-verdict-hold.ts. The shell serves it from the phone's own store, scoped to the host as before, so it never needed the desktop.

Why

The store verb never reaches the desktop (serveDeviceStoreVerb in MobileWebShellScreen.tsx), so holding it for the desktop's verdict protects nothing. It only delays writes whose whole point is to outlive a disconnect. This was found while building the offline chat send queue (#39423): a queued message, and also a plain draft typed offline (#39342), came back after a kill only if the desktop had been reachable when it was saved.

Linked Issue

Orca Mobile speed program, part of S8a / S5 (offline drafts and queued sends survive a kill). No GitHub issue.

Visual Proof

iOS simulator, desktop cut with a toxiproxy disable, then the app killed (simctl terminate), the desktop restored and the app reopened.

Before: text typed offline (" plus offline words") Before: after the kill, the offline words are gone
typed offline lost

With #39423 on top (offline queue):

Before this fix: queued offline Before this fix: after the kill, gone After: back paused with Resume After: Resume sends it once
queued gone paused sent

Numbers

Shell JS from this tree via Metro (dev client), page from the #39423 stack. A temporary log in the store verb server counted the writes:

Check without the fix with the fix
Store writes reaching the shell while the desktop is out 0 (they landed only after reconnect) written at once
Draft typed offline, kept after a kill 0/1 n/a (covered by the queue runs, same write path)
Message queued offline, back after a kill 0/1 3/3, sent 0 times before Resume, 1 time after

Testing

  • New verdict-hold test: a native.store.rows request is served before the verdict opens. It fails without the fix.

  • bridge-host* tests, pnpm check:changed.

  • iOS simulator runs above.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Risk

Shell (native JS), so it ships with the app (Store release), not Page OTA. Until a shell with this ships, an offline queue or draft is still saved, but only on reconnect. The verb is already scoped to the screen's host by the shell and never forwarded to the desktop, so serving it early changes no wire traffic. Plain revert.

Level: Low

AI Disclosure

Review

Small fix, one list entry plus a test.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Mobile shell only. #39419 also edits bridge-host-verdict-hold.ts (stream replay); this touches only the phone-only verb list.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The phone-only native verb set now includes BRIDGE_STORE_VERB, so native store messages bypass desktop verdict parking. A test sends a native.store.rows draft-read request before the connection verdict and verifies that the native store receives the call.

Merge Risk: Minimal · up to f1899

Store requests can proceed while the desktop is offline. No merge-blocking issue was established.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly describes the main change: saving mobile drafts while the desktop is offline.
Description check Passed The description is mostly complete. It explains the change, testing, visual proof, and rollback. The risk section could better describe what users would see if early store access failed. An outside co…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Description check

Explanation

The description is mostly complete. It explains the change, testing, visual proof, and rollback. The risk section could better describe what users would see if early store access failed. An outside contributor must also link an issue.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 2 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d2b81065-c982-49a9-80a7-8d60b657754f
Commits

Reviewing files that changed from the base of the PR and between 55f353f and f18990d.

Files selected for processing: 2

  • mobile/src/mobile-web-shell/bridge-host-verdict-hold.test.ts
  • mobile/src/mobile-web-shell/bridge-host-verdict-hold.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@AmoabaKelvin
AmoabaKelvin merged commit 1688a16 into main Nov 7, 2026
25 checks passed
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