Quick Actions Mute/Unmute and the Home record button drop capture failures silently
Product impact
- Primary loop layer: Capture
- [ ] Involves data loss, failed capture, or broken sync/trust
Describe the bug
Since capture commands became coordinator dispatches, pauseCapture, resumeCapture and finishCapture throw
when their effect fails (outcome.throwIfFailed()). The Live page and the processing card catch these failures
and show "Something went wrong". Two callers don't:
- The home-screen Quick Actions (long-press the app icon → Mute / Unmute) call
pauseCapture()/resumeCapture()without awaiting them, so a failure is an unhandled async error and the user gets no feedback. - The Home record button's tap handler is a
GestureDetectorthat drops the future of_startRecording, and the stop path awaitsfinishCapture()without atry. A failed stop is unhandled, and the button just keeps its state.
To reproduce
This happens when a pause, resume or finish effect fails, for example while the transcription socket or the mic can't be reopened. Use Quick Actions → Unmute, or tap the Home record button to stop.
Current behavior
Nothing on screen. The error reaches the zone's uncaught-error handler.
Expected behavior
The same "Something went wrong" feedback as the Live page, and no uncaught error.
Evidence
lib/services/quick_actions_service.dart:132— un-awaitedpauseCapture()/resumeCapture().lib/pages/home/widgets/battery_info_widget.dart:372andlib/pages/home/widgets/battery_info_widget.dart:317.
Found while testing the Omi v2 Flutter restyle on an iPhone, then confirmed against main at 32c2ed22cf.
Submitted a comprehensive surgical fix in PR #21303.
Summary of Fix:
- Quick Actions Mute/Unmute: Wrapped
pauseCapture()andresumeCapture()intry/catchwithinquick_actions_service.dart, preventing unhandled async exceptions and displayingOmiFeedback.error(context, context.l10n.somethingWentWrong)on failure. - Home Record Button: Wrapped
finishCapture()withinbattery_info_widget.dart's stop path intry/catch, surfacingOmiFeedback.error(context, context.l10n.somethingWentWrong)when the stop effect throws. - Hermetic Tests: Added widget regression tests in
capture_home_ui_test.dartand unit tests inquick_actions_service_test.dartcovering both happy-path dispatches and failure feedback.