fix: do not persist a deleted speech model as the active selection#468
Open
postoso wants to merge 1 commit into
Open
fix: do not persist a deleted speech model as the active selection#468postoso wants to merge 1 commit into
postoso wants to merge 1 commit into
Conversation
Deleting a non-active speech model temporarily wrote the deleted model to selectedSpeechModel and restored the real selection through an un-awaited defer/Task that was never awaited. If the app quit, crashed, or relaunched for an update during that window, the user was left with a model they never chose. Delete the target model's cache via the existing ASRService.clearModelCache(for:) primitive, which clears the specific model and never mutates the selection, and drop the now-unneeded suppressSpeechProviderSync / skipNextSpeechModelSync scaffolding. Refresh installed-model state after the delete so the model cards reflect the removal for non-active models too, matching the onboarding uninstall path. Add a regression test that fails if the deleted model is ever persisted as the selection, even transiently.
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.
Deleting a non-active speech model temporarily wrote the deleted model to
selectedSpeechModeland restored the real selection through an un-awaiteddefer { Task { ... } }. If the app quit, crashed, or relaunched for an update during that window, the user was left with a model they never chose.This routes per-model deletion through the existing
ASRService.clearModelCache(for:)primitive, which clears the specific model and never mutates the selection, and drops the now-unneededsuppressSpeechProviderSync/skipNextSpeechModelSyncscaffolding. It also callscheckIfModelsExistAsync()after the delete so the model cards refresh for non-active models too (the removed selection bounce had been doing that incidentally).Adds a regression test that fails if the deleted model is ever persisted as the selection, even transiently.
Refs #467 (a separate path that can leave a user on a model they did not choose).