Repository navigation
fix(mobile): keep voice settings in the order you change them - #31691
Conversation
2cf9041 to
17e2d8c
Compare
An older save that replies last could put the previous setting back on screen. Ignore mutation replies and errors that a newer change has superseded.
Key the screen by host so a late reply from a desktop the phone switched away from cannot land on the newly connected desktop's settings.
The host finishes a model delete only after removing its files, so a newer change can reply first with the model still selected. Dropping the older reply left the deleted model shown as in use; re-read instead.
A newer setting change does not replace a failed model select, download or delete, so show those errors again. Key the screen on the last connected desktop so a reconnect of the same desktop no longer remounts it.
17e2d8c to
2f7512c
Compare
[Low impact] The PR appears safe to merge; no new actionable issues remain. SummaryThe Voice screen keeps the newest settings reply, waits for pending changes before re-reading, and resets its state when the connected desktop changes.
Reviews (3) · Last reviewed commit: "fix(mobile): let Voice reads clear only ..." · Reviewed by Greptile |
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1

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:
9b1b0f30-3927-4ac6-aa26-f88ebb5d7bf7
Files selected for processing: 3-
mobile/app/voice-settings.tsxmobile/src/settings/settings-screen-state.test.tsxmobile/src/settings/voice-settings-screen.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
…ettles A read sent while a model delete is still running can return the deleted model after the delete's own reply. Skip reads while a change is pending, and re-read once when all settle if any reply was skipped.
A lone failed select or delete changed nothing on the phone, so it no longer starts a re-read that clears its error. A failed switch still re-reads to undo its optimistic flip.
A re-read after a failed or superseded change cleared the change's error before the user could read it. Keep load and change errors apart; re-read after any failure again, which also undoes a failed switch flip.
ELI5
Change a voice setting twice quickly while the desktop is slow to answer, and the first change's answer can arrive last and put the old setting back on screen. Switching desktops could also let a late answer from the previous desktop land on the new one's screen. Now the screen only takes the newest answer and keeps each desktop's settings separate.
What Changed
Neil's first version queued saves on the phone, one screen instance at a time. That isn't needed: the desktop applies
speech.dictation.setupas soon as it arrives (runtime-mobile-speech-catalog.tsconfigureupdates settings before its first await), so saves already land in the order they were sent. The phone only has to ignore stale replies. Dropping the queue also removes a bug in it: a closed screen's queue could still send after a reopened screen's newer choice.Why
Your latest choice should stay selected, and the screen should show what the desktop actually has.
Linked Issue
Maintainer-discovered regression; no issue. Related #31349 fences dictation reads; this fences Voice settings writes and desktop switches.
Visual Proof
No image: this is a timing race, and a screenshot of a switch can't show order. Evidence from the iOS simulator (dev client, Metro from this branch) paired to a headless desktop built from this branch, with one temporary, uncommitted host edit that holds the
enabled: falsereply for 4 s. Tap the switch on, off, on, 0.6 s apart, then sample the switch every ~0.5 s:93ff4832e46)Testing
mobile/src/settings/vitest: 33 passed. New tests: an older switch save that replies last (fails on main); a model delete that succeeds after a newer change (re-reads, selection cleared); a save then a delete, where the re-read must wait for the delete; a delete that fails after a newer change keeps its error through the re-read.AI Disclosure
Review
Reviewed in four rounds by Codex and Claude, plus Greptile and CodeRabbit. Fixed along the way: model-action errors hidden by a newer change; the screen remounting on every reconnect of the same desktop; an older failed save skipping its re-read; a re-read sent during a pending model delete bringing the deleted model back (Greptile/CodeRabbit); a background re-read clearing a failed change's error (Codex, Claude, Greptile). Left as-is (P3): starting a download while a model select is pending leaves the drawer open.
Merge risk: low. Mobile only, no protocol or host change, so mixed phone/desktop versions are unaffected.
Agent skill upstream boundary
Notes
Folder workspaces and remote hosts use the same Voice screen and RPCs; nothing here depends on the workspace kind. Desktop has its own Voice settings UI, which this doesn't touch.
Checklist