Skip to content

fix(capture): finish with nothing heard stays on Home without processing row (#19235) - #21324

Merged
kodjima33 merged 3 commits into
BasedHardware:mainfrom
Dragonire9:fix/finish-empty-capture-home-19235
Oct 13, 2026
Merged

kodjima33 merged 3 commits into
BasedHardware:mainfrom
Dragonire9:fix/finish-empty-capture-home-19235

Conversation

@Dragonire9

@Dragonire9 Dragonire9 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary & Product Impact

Resolves #19235.

When finishing a capture session where nothing was heard (both segments and photos are empty):

  1. Previously, _stopConversation unconditionally invoked switchHomeToConversationsTab(context), bouncing the user to the Conversations tab even if they had captured nothing.
  2. Concurrently, finishCapture() triggered the processing stage, adding an optimistic "Processing" placeholder skeleton row that would flash on screen and vanish once the backend returned that there was nothing to process.

Changes

  1. app/lib/pages/conversation_capturing/page.dart:

    • In _stopConversation, check provider.segments.isNotEmpty || provider.photos.isNotEmpty.
    • When content was heard, preserve the full finish & switch to Conversations tab flow (await provider.finishCapture(), switchHomeToConversationsTab(context)).
    • When nothing was heard, skip finishCapture and tab switching: cleanly stop/pause active live recording (stopStreamRecording() for phone mic, or pauseCapture() if supported on device) and pop the route back to Home without bouncing tabs.
  2. app/test/widgets/process_now_conversations_tab_test.dart:

    • Added hermetic regression test 'with nothing heard, Finish saves nothing and stays on current Home tab': verifies forceProcessingCalls == 0 (no optimistic processing row), preserves the existing Home tab, and closes the capturing page.
    • Updated _pumpCapturingPage harness helper with heard toggle (defaults to true).
  3. app/test/widgets/capturing_finish_swipe_back_test.dart:

    • Added test 'a finish with nothing heard closes the page and stays on the current tab'.
    • Ensured harness has segment data for the active conversation swipe-back test.

Verification

  • Verified 0 competing open PRs.
  • Clean regression tests covering both heard and silent captures.

View guided diff

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks @Dragonire9 — this cleanly fixes #19235 and matches the issue's expected behavior. Reviewed against the capture coordinator and controller at this head.

app/lib/pages/conversation_capturing/page.dart — the content path is unchanged (finishCapture + switchHomeToConversationsTab), and the new empty path is sound: stopStreamRecording() dispatches PhoneStopRequested, which for a live phone session runs the full teardown in _stopPhoneLiveBody (WAL flush, session roll, mic stop, socket stop) and is a safe no-op when nothing is live; pauseCapture() maps to _reducePause, which is well-defined for every capture phase. The canPause && !isPaused guard also correctly makes this idempotent when the pendant is already paused, and photo devices (OpenGlass / Ray-Ban Meta) are excluded from pausing by the shared canPause rule, consistent with the live card. Skipping processing when segments and photos are both empty mirrors the existing hadContent check in _suspendPendantBody, so the pattern has precedent.

app/test/widgets/capturing_finish_swipe_back_test.dart — good regression coverage: the new test asserts the page closes and the current tab is preserved, and backfilling a segment via the heard toggle keeps the existing swipe-back tests exercising the content path.

app/test/widgets/process_now_conversations_tab_test.dart — the forceProcessingCalls == 0 assertion is exactly the right check for "no empty Processing row", and the heard toggle on _pumpCapturingPage is a tidy harness change.

Two non-blocking questions for a maintainer:

  1. For a pendant with nothing heard, Finish now pauses the capture (pauseCapture), whereas the old finishCapture left the pendant recording after processing. If a user finishes an empty pendant session, they now need to manually resume from Home — is that the intended product behavior?
  2. An empty phone-live session now skips forceProcessingCurrentConversation entirely. That matches the backend's "nothing to process" answer in the issue, but it also means a session whose audio was buffered to the WAL with zero returned segments never gets a processing pass. Probably fine, but worth a maintainer's eye.

Nice work on the tests especially — they're hermetic and assert the right things.

[Feedback is AI-generated on the maintainer's behalf.]


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Dragonire9

Copy link
Copy Markdown
Contributor Author

@Git-on-my-level Thank you for the thorough review and validating the capture coordinator and hermetic tests!

On the two product questions:

  1. Pendant with nothing heard (pauseCapture): Yes ? as noted in Finish with nothing captured still jumps to Conversations and shows a 'Processing' row #19235 ('Finish stops or pauses capture, closes the Live page, and stays on Home'), tapping Finish explicitly signals the user wants to end the active session from the Live page rather than leave the pendant recording silently in the background. If canPause && !isPaused, pausing transitions the Home card cleanly so the user sees the paused state and can resume whenever ready.
  2. Empty phone-live session skipping forceProcessingCurrentConversation: Confirmed ? when segments.isEmpty && photos.isEmpty, no speech or photo content was recognized, so calling forceProcessingCurrentConversation only triggers the backend's empty-conversation discard while briefly flashing an empty 'Processing' row on the Conversations tab. stopStreamRecording() still flushes and rolls any local WAL state cleanly.

Ready for merge whenever convenient!

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mobile bug fix for #19235: verified main still unconditionally calls finishCapture()+switchHomeToConversationsTab on an empty capture; fix is scoped (57 lines) with new regression tests covering heard vs. silent finish. Confidence 5/5.

@kodjima33
kodjima33 merged commit a7fc001 into BasedHardware:main Oct 13, 2026
1 check passed
@Dragonire9

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and merging! 🙏

Bounty Payout Details:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flutter flutter work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Finish with nothing captured still jumps to Conversations and shows a 'Processing' row

3 participants