Repository navigation
Don't let the phase stream's opening .idle end the iPhone's first dictation - #413
Merged
Merged
Conversation
DictationSession.phaseStream() opens on the session's current phase. The coordinator subscribes from start(), so a fresh session's .idle sat in the stream until the observer next ran on the main actor; a press accepted in that gap set inFlight, and the .idle (terminal) then rendered and ran dictationEnded: inFlight cleared, the watchdog stopped, the owner's release acked nothingInFlight, and the session recorded on. That is the address-sanitizer failure of "a release from the owner" on PR #410: commandAck .nothingInFlight, stopAccepted unset, no stopAddress, no result, the phase never .pasted, the test out at 60 s. The stream's opening phase now renders only when it differs from what the coordinator already shows: a fresh session's .idle is no news, while a press the session took first, or a dictation that already ended, still renders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
3 tasks done
alexkroman
enabled auto-merge
November 25, 2026 17:27
SwiftLint's file_length (and check.sh's size budget) failed at 401. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
alexkroman
pushed a commit
that referenced
this pull request
Nov 25, 2026
Brings in #413's coordinator fix for ios-sanitizers (address). One conflict: LibraryAccessibilityAuditUITests, where #405 added the Library menus test and this branch the live-recording page; both are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1TXn83VM7ihZ3iFgU5
2 of 3 tasks
alexkroman
pushed a commit
that referenced
this pull request
Nov 25, 2026
… CI run Recent multi-commit PRs (#410, #413, #414, #416, #420, #422, #423, #425, #426) mostly spent their extra ~37-minute runs on things nothing caught before CI: - scripts/check-swift-lint-lite.sh: a toolchain-free text match for the opt-in SwiftLint/swift-format rules it can see (modifier_order, no_empty_block, NoBlockComments, swift-format's `catch where`). Run by check.sh (so --portable and --lint-only) and the swift-budgets edit hook; would have flagged the pre-fix files of #414, #422 and #425. - .claude/hooks/push-gate.sh: a PreToolUse hook that runs `check.sh --portable` (~20 s) before any `git push` and blocks a red one — jscpd clones (#420, #422) and post-merge size overruns (#363, #378) were pushes that skipped the documented portable run. - AGENTS.md / CLAUDE.md: a "Rules only CI catches" list for the rest (variable_shadowing, one_declaration_per_file, type_contents_order, multiline_function_chains, MemberImportVisibility, one argument per line), and the new hook and script in the hooks table and permissions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1UDUZXyuF6g7GUmmNu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The failure
On #410,
ios-sanitizers (address)failed inDictation coordinator› "a release from the owner…". The 7 failed expectations:.nothingInFlight.stopAcceptedandstopAddresswere never set..pasted, and the test ran out at 60 s.#410 doesn't touch the iPhone, so the cause is on main.
The cause
DictationSession.phaseStream()starts by sending the session's current phase.DictationCoordinator.start()subscribes from a task, so a fresh session's.idlewaits in the stream until that task next runs on the main actor.A press accepted in that gap sets
inFlight. Then the waiting.idle, which counts as terminal, renders and callsdictationEnded. That clearsinFlightand stops the watchdog. The owner's release finds nothing in flight, and the session records until the test gives up. The address sanitizer's slowdown widens the gap enough for this to happen.The fix
observePhases()skips the stream's first phase when it matches the phase the coordinator already shows, which on a fresh coordinator is.idle. A first phase that differs still renders, such as a press the session took before subscribing (.connecting,.recording, a readiness.failed) or a dictation that already ended. Skipping it has no side effects:start()publishes.idleitself, and the rest ofdictationEndeddoes nothing on a fresh launch.The
swift6-concurrency-revieweragent confirmed the diagnosis and that the fix is race-free. One case it can't tell apart is a dictation that ends with.idle(a too-short tap) before the observer's first subscription. That would need a press and its release both handled before the subscription's first hop to the session actor, whichstart()queues ahead of any command.Testing
No new test. Making a press land between the subscription and its first render needs a hook in the coordinator;
ownerReleaseunder the address sanitizer is the test that hits this.scripts/check.sh --portablepasses; CI runs the Swift build and tests.Generated by Claude Code