Repository navigation
Fix Keychain unavailability handling in sign-in and renewal - #361
Merged
Merged
Conversation
…CSV column (#344) - AssemblyAIAccount: a session item that reads again refreshes the API-key model too, so a Mac locked at launch doesn't show "Signed in as …" while hasAPIKey stays false and the wizard holds the user in onboarding. - AssemblyAIAccount.storeSignIn: refuse over an unreadable session item instead of rolling back to nil, which deleted it. - DictationCoordinator.claimPress: keep a stop recipient a fast release set before the session claimed the press. - KeyboardRelayInjector: a dictation cancelled mid-delivery takes its result back out of the App Group, so the keyboard can't insert it later. - voicearena_baseline.py: write each CSV column once, and give non-default hosts a cache tag that neither crashes on a dotless host nor collides across *.assemblyai.com (staging keeps its existing tag). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DS5B1S9WP9RXzy9e669hiB
alexkroman
enabled auto-merge
November 24, 2026 22:50
A result was addressed to a keyboard process only, so a keyboard over a
different field in the same process — the user tapped field B while the
words for field A were still being transcribed, with iOS keeping the
controller or bringing up a new one — inserted them there.
The press and stop commands now carry the field's
UITextDocumentProxy.documentIdentifier beside the controllerID they
already sent; the coordinator keeps a ResultAddress (process, controller,
document) for the press and for the accepted stop, and the relay puts it
on the DictationResult. A keyboard inserts only when the result names its
controller and document; otherwise it leaves the result, and the app
copies the words out at its delivery timeout ("Copied"), as when no
keyboard takes them. A part left nil by an older build matches anything.
Fixes #346
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # App/BlurtiOS/BlurtiOSTests/DictationCoordinatorTests+Dictation.swift
alexkroman
pushed a commit
that referenced
this pull request
Nov 25, 2026
Matches KeyInjector.insert's default, so a test calling the relay directly describes an ordinary field without restating it (and #361's new relay test keeps compiling once this lands). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # App/BlurtiOS/BlurtiOSTests/DictationCoordinatorTests+Dictation.swift # App/BlurtiOS/BlurtiOSTests/ProtocolTests.swift
alexkroman
enabled auto-merge
November 25, 2026 00:37
#378 adds its own test at the same spot; apart, the two merge in either order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What & why
This PR fixes several issues around Keychain unavailability (e.g., when locked at launch):
Session renewal with locked Keychain: When a Mac is locked at launch, the session can be read again after unlock, but the API key status wasn't refreshed. This caused the UI to show "Signed in as …" while
hasAPIKeyremained false, keeping the wizard in onboarding. NowrefreshStatus()is called after a successful session read to sync the key status.Sign-in over unreadable session: When a session item can't be read (
.unavailable), attempting to sign in would try to roll back tonil, effectively deleting the unreadable session. This is unsafe — that session may be the only way to renew or revoke an earlier grant. Now sign-in refuses outright if the current session can't be read, preserving it.Press claim race condition: A quick release command could be accepted before the session claims the press, but the claim would overwrite the stop recipient. Now the claim preserves an already-set recipient, allowing the release to land first without losing where the dictation's words should go.
Cancelled dictation cleanup: When a dictation is cancelled while waiting for the keyboard to take the result, the result was left in the App Group, and the keyboard would still insert it. Now cancellation cleans up the result if it's still the one being waited for.
Voice Arena baseline tooling: Added
_host_tag()to safely generate cache filenames for non-default hosts, andwrite_csv()to ensure consistent column ordering in baseline output.How it was tested
Added
LockableKeyStoretest fixture to simulate locked Keychain scenariosAdded test
signInOverUnreadableSession()verifying sign-in refuses and doesn't delete unreadable sessionsAdded test
relayCancelledTakesResultBack()verifying cancelled dictations clean up their resultsAdded test
releaseBeforeClaim()verifying press claim preserves recipient set by earlier releaseAdded tests for
_host_tag()andwrite_csv()in Voice Arena baselinescripts/check.shpasses (or CI will, if I'm not on a Mac)I read AGENTS.md and this doesn't reintroduce anything deliberately removed
Docs updated if behavior changed