- Replace force-unwrapped URLs in cloud transcription services with safe guard statements
* GroqTranscriptionService: Add URL validation before use
* ElevenLabsTranscriptionService: Add URL validation before use
* MistralTranscriptionService: Add URL validation before use
* OpenAICompatibleTranscriptionService: Add URL validation before use
- Replace fatalError in VoiceInk.swift with graceful degradation
* Implement in-memory fallback when persistent storage fails
* Add user notification for storage issues
* Use proper logging instead of fatal crash
- Fix dictionary force unwrap in WhisperPrompt.swift
* Add safe fallback when default language prompt missing
* Prevent potential crash on dictionary access
- Wrap debug print statement in #if DEBUG directive
* Eliminate production logging overhead in VoiceInk.swift
These changes prevent 6+ potential crash scenarios while maintaining
full functionality with graceful error handling.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Add atomic guards using ManagedAtomic to ensure continuations are resumed
exactly once in TaskDelegate, downloadFileWithProgress, and unzipCoreMLFile
functions. This resolves crashes during model downloads and transcription
when multiple callback paths race to resume the same continuation.
Changes:
- Import Atomics framework for atomic operations
- Add ManagedAtomic guards to prevent double resume
- Implement finishOnce helper pattern for consistent error handling
- Add proper cancellation handling in downloadFileWithProgress
Fixes crashes with stack trace: EXC_BREAKPOINT → _assertionFailure →
CheckedContinuation.resume(returning:) → VoiceInk [0x102dbfcc4, 0x102dc1174]