Repository navigation
Allow another phone send after delivery is unconfirmed - #26392
Conversation
|
When the built-in chat on the phone lost its Send confirmation, sending identical text again could keep returning “Delivery unconfirmed” because the saved payload fingerprint reused the unresolved attempt. A later Send now gets a fresh message identity, including after reopening the app; the host retains the original attempt and prevents repeated delivery of that same attempt. Removed the fingerprint-only journal and related matching/reconciliation paths. It stored no text and could not recover a message. The main conflict is resolved without restoring image fingerprints: the journal was their only consumer, so the unused native/browser hash code, tests, dependency and browser override are also removed. Image uploads no longer compute an unused hash; shared host payload hashes and the wire shape are unchanged. A deliberate later Send can produce another copy if the unknown first attempt reached the agent. Intended difference: no durable phone outbox is added. A phone killed between Send and host recording loses that text today and still does. The original-code unit repro and byte-for-byte ablation fail both equal-text cases. The merged fix passes 241 focused mobile tests, 1,201 recording/replay tests and 48 host/storage/render checks. Fresh queued mobile, renderer, main-process and CLI typechecks and the mobile test ratchet pass. Earlier independent review found no P0–P3 defects; the coordinator reviewed and approved this exact merged head and its unused image-hash removal. Native iOS simulator screenshots in the PR body are carried forward: equal-text resend after host/app recovery, ordinary Send, and current-host busy Send completed. The busy fixture refuses steer, covering the supported direct-start fallback. Queue support remains deliberately dark; capable-host cards have unit coverage. Original-code native setup was blocked; native QA was not repeated for this merge cleanup. Physical phones, real-provider steer, live SSH and native Windows/Linux UI were not exercised. Final head Local repository checks passed 21/22; the sole failure is five import-cycle warnings reproduced with identical file/line/messages on archived merged-main source. Runtime English catalog verification passed. The PR remains ready and unmerged. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (8)
💤 Files with no reviewable changes (5)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughMobile structured sends no longer persist or reuse operation IDs after ambiguous results. Each Send follows the new-action path, while existing unknown submissions remain in session state. The delivery mapper classifies results without retained-send state. Attachment contracts and upload results no longer include content fingerprints. Tests and reliability-gate records were updated to reflect these changes. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk was identified in the reviewed change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
mobile/src/session/use-mobile-structured-agent-session-send.test.tsx (1)
179-179: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the fixture-only assertion.
event.page.submissions[0]?.dispatchStatereads the test fixture, not hook-owned state. It cannot detect a hook change.The existing
expect(hook!.session.messages).toEqual(messages)assertion does check the projected message list and can detect a visible row replacement. However, the hook does not exposesubmissions, andNativeChatMessagedoes not includedispatchState. Do not replace this withhook!.session.submissions. Remove the ineffective assertion, or test dispatch state through a lower-level state API if that state must be covered.♻️ Suggested fix
- expect(event.page.submissions[0]?.dispatchState).toBe('unknown')
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
94a4477f-b18f-488a-9294-9d6ac2898a0d
📒 Files selected for processing (36)
config/reliability-gates.jsoncconfig/scripts/mobile-mirrored-storage-write-path.test.mjsconfig/scripts/mobile-web-app-session-render.test.mjsmobile/rpc-foundation/goldens/native-chat-image-upload-second-fails.jsonmobile/rpc-foundation/goldens/native-chat-image-upload-single.jsonmobile/rpc-foundation/goldens/native-chat-image-upload-two.jsonmobile/src/mobile-web-shell/page-storage-keys.tsmobile/src/session/mobile-native-chat-controller-contract.tsmobile/src/session/mobile-native-chat-image-attachment.test.tsmobile/src/session/mobile-native-chat-image-attachment.tsmobile/src/session/mobile-structured-agent-session-rpc.tsmobile/src/session/mobile-structured-agent-session-send-bypass.test.tsmobile/src/session/mobile-structured-agent-session-send.tsmobile/src/session/mobile-structured-send-delivery.test.tsmobile/src/session/mobile-structured-send-delivery.tsmobile/src/session/mobile-structured-send-new-action.test.tsmobile/src/session/mobile-structured-send-operation-journal.test.tsmobile/src/session/mobile-structured-send-operation-journal.tsmobile/src/session/mobile-structured-send-page-storage-refusal.test.tsmobile/src/session/use-mobile-native-chat-controller.tsmobile/src/session/use-mobile-native-chat-image-attachments.test.tsmobile/src/session/use-mobile-native-chat-session-lane.tsmobile/src/session/use-mobile-session-image-attachments.tsmobile/src/session/use-mobile-structured-agent-session-background-tasks.test.tsxmobile/src/session/use-mobile-structured-agent-session-newer-approval-send.test.tsxmobile/src/session/use-mobile-structured-agent-session-prompt-cancel.test.tsxmobile/src/session/use-mobile-structured-agent-session-queued.test.tsxmobile/src/session/use-mobile-structured-agent-session-read-failure.test.tsxmobile/src/session/use-mobile-structured-agent-session-send.test.tsxmobile/src/session/use-mobile-structured-agent-session.test.tsxmobile/src/session/use-mobile-structured-agent-session.tsmobile/src/session/use-mobile-structured-native-chat-send-bridge.tsmobile/src/session/use-mobile-structured-send-operation-reconciliation.tsmobile/src/session/use-mobile-structured-send-with-outcome.tsmobile/src/storage/mirrored-storage-keys.tsmobile/tests-typecheck-baseline.txt
💤 Files with no reviewable changes (15)
- mobile/src/session/use-mobile-native-chat-controller.ts
- mobile/src/session/mobile-structured-send-operation-journal.test.ts
- mobile/src/session/mobile-native-chat-controller-contract.ts
- mobile/tests-typecheck-baseline.txt
- mobile/src/session/use-mobile-structured-agent-session-prompt-cancel.test.tsx
- mobile/src/session/use-mobile-session-image-attachments.ts
- mobile/src/session/use-mobile-structured-send-operation-reconciliation.ts
- mobile/src/session/mobile-structured-send-page-storage-refusal.test.ts
- config/scripts/mobile-mirrored-storage-write-path.test.mjs
- mobile/src/session/use-mobile-structured-native-chat-send-bridge.ts
- mobile/src/session/use-mobile-structured-agent-session.ts
- mobile/src/session/use-mobile-native-chat-session-lane.ts
- mobile/src/session/mobile-structured-agent-session-send-bypass.test.ts
- mobile/src/session/use-mobile-structured-send-with-outcome.ts
- mobile/src/session/mobile-structured-send-operation-journal.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.
ELI5
When the built-in chat on the phone lost confirmation that a Send reached the host, sending the same text again could keep showing “Delivery unconfirmed” forever. The phone treated matching text as the same old attempt, so the host correctly returned that attempt’s unresolved result instead of sending the new message.
A later tap on Send now creates a new message, including after reopening the app. The original message keeps the host’s recorded status.
What Changed
Each structured phone Send uses the existing mutation sender’s fresh operation ID. Removed the saved fingerprint-only send journal, its cleanup hook, alternate capability matching, attachment-path substitution, and automatic resends after withdrawal. New sends use their current uploaded images and the currently connected host’s advertised queue support.
The old page-storage key remains permitted so phone apps can still load an older host’s embedded page bundle. The request shape and host-side duplicate protection are unchanged.
The main conflict is resolved by keeping the image-content fingerprint removed. Its only consumer was the deleted send journal, so also removed the unused image hash dependency, native/browser fingerprint modules and tests, browser override entry, and the serialization wrapper introduced for browser hashing. Attaching an image no longer computes an unused hash; the host's shared payload fingerprint still hashes the identical canonical input.
Why
The removed journal stored IDs, fingerprints, and image paths; it stored no message text and provided no recovery outbox. Expiring or rotating its payload records would keep two competing accounts of a send and leave storage failures capable of blocking Send. The host already owns admitted messages and queued cards, while a person’s later Send is a separate action.
Differences from the common pattern:
Linked Issue
N/A — maintainer follow-up from a native chat audit.
Visual Proof
Native iOS simulator captures use the device framebuffer. Captured from the device framebuffer because opening another Simulator window would disturb the shared desktop. All input used Orca emulator on an isolated device, with an isolated host and a stand-in agent.
After host restart and app relaunch, the original bubble remains and Send is available. The host journal still records its delivery as unknown; the phone shows no uncertainty badge. This is the state before the next Send on the fixed build, not an original-code baseline:
A new Send of the same text completes. The journal and provider transcript confirm a distinct new message ID and accepted delivery:
An ordinary Send also completes:
Current-host Send while busy also completes with a fresh ID. The stand-in deliberately refuses steer, so this verifies the host's supported direct-start fallback, not a real-provider steer:
The original-code native repro was blocked during rig setup. The original-code unit repro and byte-for-byte ablation are the before-fix proof.
Testing
The original-code unit repro and byte-for-byte ablation fail the exact lost-answer/same-text sequence, including after remount. After this conflict-resolution sync, all 241 tests in 19 focused mobile files, 1,201 recording/replay tests in two files, and 48 host-ledger, storage and rendering checks in eight files passed. The image-upload recordings retain identical requests and wire payloads. Fresh queued mobile production, renderer, main-process and CLI typechecks and the mobile test typecheck ratchet passed. Repository checks passed 21/22; the only failure is five import-cycle warnings independently reproduced with identical file/line/messages on source archived from the merged main parent. Runtime English catalog verification passed.
Final head
4a83a2730c4f0339d4a65aac56ff8a104cc65192: all 37 checks completed, with 23 passed and 14 skipped; skipped jobs are not passes. PR Checks passed all ten unit shards, relay integration, static analysis/typecheck, the mobile web bundle, wire compatibility, and both packaging jobs. Mobile Checks passed the full mobile suite; Headless checks passed persistence on Ubuntu. No red or pending CI checks remain.The existing native iOS simulator evidence is carried forward: equal-text resend after host/app recovery, ordinary Send, and busy Send through the current host's supported direct-start fallback passed. The stand-in refuses steer, so real-provider steer is unverified. Queue support remains deliberately dark on shipped hosts; capable-host cards have unit coverage. Original-code native setup was blocked; the unit repro and ablation provide the before-fix proof. Native QA was not repeated for this merge/dead-code cleanup; physical phones, live SSH and native Windows/Linux UI were not exercised.
Review
The earlier independent review found no P0–P3 defects and passed 258 targeted tests. The coordinator approved merged head
4a83a2730c4f0339d4a65aac56ff8a104cc65192after checking that the resolution preserves the reviewed send design, removes only the unused image-fingerprint additions, leaves shared canonical payload hashes unchanged, and has no remaining references to removed symbols. Persistence and retry parity remain outside this change.Agent skill upstream boundary
Notes
Phone-only change; no host, remote-execution, path, or shortcut behavior changes. The same per-action identity applies to SSH hosts and folder workspaces. Mixed-version requests retain capability gating.
Checklist