fix: stop swallowing exceptions in import fire-and-forget pipeline runners#176
Open
davidortinau wants to merge 1 commit into
Open
fix: stop swallowing exceptions in import fire-and-forget pipeline runners#176davidortinau wants to merge 1 commit into
davidortinau wants to merge 1 commit into
Conversation
Replace empty catch blocks in StartImport, RetryImport (ImportEndpoints) and TriggerCheck (ChannelEndpoints) with proper error handling: - Log the exception via ILoggerFactory (Error level) - Call FailImportAsync to mark the import as Failed with the error message Make VideoImportPipelineService.FailImportAsync public so endpoints can call it directly without needing a separate repository reference. Previously, exceptions thrown before internal pipeline logging (DI resolution failures, scope creation errors, first pipeline step) were silently swallowed, leaving the import permanently stuck in Pending. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Problem
Three fire-and-forget
Task.Runblocks in the import/channel endpoints had empty catch bodies with a misleading comment:This comment is incorrect for exceptions thrown before the pipeline service's own try/catch (e.g. DI resolution failures, scope creation errors, the first pipeline step). When that happens:
exis silently discardedFailed/api/imports/{id}sees the import permanently stuck inPendingFix
Replace the empty catch with logging + status update in all three call sites:
Changes
VideoImportPipelineService.cs— promotedFailImportAsyncfromprivatetopublicso endpoint handlers can call itImportEndpoints.cs—StartImportandRetryImportcatch blocks now log the error and mark the import failedChannelEndpoints.cs— channel video trigger loop catch block gets the same fixVerification
dotnet build src/SentenceStudio.Api/— ✅ clean (0 errors)dotnet test tests/SentenceStudio.Api.Tests/— 120 pass; 19 failures are pre-existing onmain(IChatClientnot registered in auth test DI harness, unrelated to this change)