Files
Lumotia/docs/issues/poll-inference-channel-fatality.md
Jake 9b0067b4c0
Some checks failed
check / cargo check (macos-latest) (push) Has been cancelled
check / cargo check (ubuntu-22.04) (push) Has been cancelled
check / cargo check (windows-latest) (push) Has been cancelled
check / svelte build + lint (push) Has been cancelled
Land release blocker fixes and workspace cleanup
2026-04-23 00:16:09 +01:00

50 lines
2.2 KiB
Markdown

# RB-05 MAJOR: poll_inference treats IPC listener loss as session-fatal
**Severity:** MAJOR
**Path:** `src-tauri/src/commands/live.rs:721-813`
**Source:** [2026-04-22 code review](../code-review-2026-04-22.md)
**Labels:** release-blocker, major, ipc-lifecycle
**Status:** RESOLVED (2026-04-22)
## Resolution
`poll_inference` no longer propagates `result_channel.send(...)` with `?`.
Instead, live-result delivery is routed through a small helper that
tracks whether the frontend listener has already been lost:
- First send failure: mark the result listener as unavailable, log a
warning, and best-effort send a `LiveStatusMessage::Warning`
explaining that transcription will continue in the background until
the user stops the session.
- Subsequent chunks: skip re-sending to the dead result channel and
keep the worker running.
Crucially, this path is now separate from actual transcription failure:
inference errors still emit `LiveStatusMessage::Error` and stop the
session, while listener-loss just stops live preview delivery.
Regression test:
- `result_listener_loss_is_warned_once_and_not_treated_as_inference_failure`
simulates a dead result channel, confirms the first processed chunk
downgrades to a warning, and confirms a second chunk still processes
successfully without a second warning.
## Problem
`result_channel.send(...)` propagates with `?`, so closing the listening frontend or reloading the webview terminates the whole live session — even when capture and inference are healthy. Tauri channel-lifecycle events are not transcription failures and should not kill the worker.
## Acceptance
- Channel-send errors log a warning and continue the session (if recoverable) or terminate gracefully (if the session was going to end anyway).
- The distinction between "transcription failed" and "no listener to report to" is explicit in the error handling.
- Regression test: simulate channel close mid-session, assert the worker keeps capturing and produces a valid WAV file.
## Fix scope
Medium. Isolated to `poll_inference` and its error handling; interacts with RB-04 (monolith refactor) since that restructures the same function family.
## Dependencies
- **Related:** RB-04.