omi icon indicating copy to clipboard operation
omi copied to clipboard

Quick Actions Mute/Unmute and the Home record button drop capture failures silently

Open Itaxh1 opened this issue 2 months ago • 1 comments

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 GestureDetector that drops the future of _startRecording, and the stop path awaits finishCapture() without a try. 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

Found while testing the Omi v2 Flutter restyle on an iPhone, then confirmed against main at 32c2ed22cf.

Itaxh1 avatar Sep 26 '26 17:09 Itaxh1

Submitted a comprehensive surgical fix in PR #21303.

Summary of Fix:

  • Quick Actions Mute/Unmute: Wrapped pauseCapture() and resumeCapture() in try/catch within quick_actions_service.dart, preventing unhandled async exceptions and displaying OmiFeedback.error(context, context.l10n.somethingWentWrong) on failure.
  • Home Record Button: Wrapped finishCapture() within battery_info_widget.dart's stop path in try/catch, surfacing OmiFeedback.error(context, context.l10n.somethingWentWrong) when the stop effect throws.
  • Hermetic Tests: Added widget regression tests in capture_home_ui_test.dart and unit tests in quick_actions_service_test.dart covering both happy-path dispatches and failure feedback.

Dragonire9 avatar Oct 12 '26 10:10 Dragonire9