Summary
When a task stage (download/transcribe/summarize) calls BeginStage successfully but later hits an error path that returns without going through recordTaskError, the task status stays in the in-progress state (e.g. downloading). The Error field remains empty, so the UI believes the stage is still running and blocks manual retries. This effectively deadlocks the task until the backend restarts.
Impact
- Users cannot recover a task after certain transient failures (for example, an
UpdateTaskStatus persistence error).
- Buttons remain disabled on the Task page because the stage appears busy.
Proposal
Introduce a helper (e.g. withStage(...)) or a defer wrapper that guarantees we persist a failure state whenever a stage function exits with an error after BeginStage has succeeded. This likely requires a broader rethink of stage orchestration, so we should track it separately to unblock the current PR.
References
app.go:308-396, app.go:357-411, app.go:417-505
internal/services/taskmanager.go:123-157
Summary
When a task stage (download/transcribe/summarize) calls
BeginStagesuccessfully but later hits an error path that returns without going throughrecordTaskError, the task status stays in the in-progress state (e.g.downloading). TheErrorfield remains empty, so the UI believes the stage is still running and blocks manual retries. This effectively deadlocks the task until the backend restarts.Impact
UpdateTaskStatuspersistence error).Proposal
Introduce a helper (e.g.
withStage(...)) or adeferwrapper that guarantees we persist a failure state whenever a stage function exits with an error afterBeginStagehas succeeded. This likely requires a broader rethink of stage orchestration, so we should track it separately to unblock the current PR.References
app.go:308-396,app.go:357-411,app.go:417-505internal/services/taskmanager.go:123-157