Skip to content

Fix crash: wrap transcription coroutine in try/catch#3

Open
deepseven wants to merge 1 commit intoskorokithakis:masterfrom
deepseven:pr/fix-transcription-crash
Open

Fix crash: wrap transcription coroutine in try/catch#3
deepseven wants to merge 1 commit intoskorokithakis:masterfrom
deepseven:pr/fix-transcription-crash

Conversation

@deepseven
Copy link
Copy Markdown

The fire-and-forget scope.launch(Dispatchers.IO) block that runs transcription has no top-level exception handler. If TranscriptionClient.transcribe() throws an unexpected exception (e.g. malformed URL, SSL error, OOM), it propagates as an uncaught coroutine exception and crashes the entire app process.

The crash is particularly bad because the app restarts, syncs again, re-downloads the same file, tries to transcribe again, and crashes in an infinite loop.

Fix: wrap the coroutine body in try/catch so transcription errors are logged but never kill the sync service.

The fire-and-forget scope.launch(Dispatchers.IO) block that runs transcription has no top-level exception handler. If TranscriptionClient.transcribe() throws an unexpected exception (e.g. malformed URL, SSL error, OOM), it propagates as an uncaught coroutine exception and crashes the entire app process.

The crash is particularly bad because the app restarts, syncs again, re-downloads the same file, tries to transcribe again, and crashes in an infinite loop.

Fix: wrap the coroutine body in try/catch so transcription errors are logged but never kill the sync service.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant