Repository navigation
Description
TL;DR: Tap Finish on the live transcription page and swipe back right away, and the whole app goes black and stays black. It is not a crash (no crash report, the process keeps running): the Finish handler's Navigator.pop() lands after the swipe has already popped the page, so it removes Home and leaves the root navigator empty. The recording itself is saved and processed. One-line guard in conversation_capturing/page.dart plus a regression test. Fix: #20375 (a Codex session worked on it; the regression test fails without the fix and passes with it).
iPhone 15 Pro Max, iOS 26.6.2, app 1.0.543 (992), Dark mode, phone-mic recording. Taken the moment it happened.
Product impact (see PRODUCT.md and ISSUE_TRIAGE_GUIDE.MD)
- Primary loop layer: Capture
- Involves data loss, failed capture, or broken sync/trust. No data is lost:
finishCapture()completes and the conversation is processed (the WAL files were written). But it looks exactly like a crash at the end of a recording, which is where trust in capture is won or lost.
Describe the bug
Finishing a phone-mic recording from the live transcription page and swiping back at about the same time leaves the app on a black screen. Nothing responds. Only force-quitting and relaunching brings the app back.
To Reproduce
- Home → record with the phone mic.
- Tap the live card to open the transcription page (
ConversationCapturingPage). Speak for a few seconds. - Tap Finish.
- Within about half a second, swipe back from the left edge (the iOS back gesture).
- The page animates out, then the screen goes black and stays black.
It is a timing window, so it does not hit every time: Finish has to resolve while the swiped-away page is still animating out. On a real phone finishCapture() (stop the mic, process the conversation) takes long enough that a quick swipe after the tap lands in the window often.
Current behavior
Black screen, no UI, no crash. The process is still alive (no Runner-*.ips and no Jetsam event were written; the process from that launch was still running when checked). Force-quit is the only way out.
Expected behavior
Finish ends the recording, the page closes (by the Finish or by the swipe, whichever comes first), and Home shows the Conversations tab with the processing row. A swipe during the finish must never remove Home.
Screenshots
Above.
user ID (can we access the user info to validate the bug?):
Available on request.
Smartphone + device (please complete the following information):
- Device: iPhone 15 Pro Max
- OS: iOS 26.6.2
- App Version: 1.0.543 (992), a build of
mainplus the open design PRs; the affected file is unchanged by those PRs, somainhas it too - Device version: not involved (phone mic)
Additional context
Root cause, app/lib/pages/conversation_capturing/page.dart, _stopConversation:
await provider.finishCapture();
if (!mounted) return;
switchHomeToConversationsTab(context);
Navigator.of(context).pop();The swipe pops the route, but the route's widget tree stays mounted for the Cupertino exit transition (~500 ms; omiPageRoute is a CupertinoPageRoute on iOS). If finishCapture() resolves inside that window, mounted is still true and Navigator.of(context).pop() pops whatever is on top now. That is Home, the only route of the root navigator (it is pushed with pushAndRemoveUntil). An empty navigator paints black.
The back gesture itself is not popping twice: Flutter 3.44's _CupertinoBackGestureController.dragEnd only pops when the route is still current. The late programmatic pop is the one that lands wrong.
Verified with a widget test using the real omiPageRoute on the iOS platform variant: push a page whose finish is a Completer, pop the route, pump 100 ms (page still mounted, mid-transition), complete the finish. Home is gone. With the pop guarded on the route still being current, Home stays.
Where in the code
app/lib/pages/conversation_capturing/page.dart:_stopConversation(the pop)app/lib/ui/omi_routes.dart:omiPageRoute(CupertinoPageRoute on iOS, so the swipe gesture and the exit transition apply)- The same await-then-pop shape exists in Home's record-button path (
battery_info_widget.dart_startPhoneRecording), but it does not pop, so it is not affected.
Proposed fix
Keep the tab switch, and pop only when this page's route is still the current one:
final route = ModalRoute.of(context);
if (route != null && route.isCurrent) Navigator.of(context).pop();Plus a regression test that reproduces the timing (pop during the await, finish resolves mid-transition) and asserts Home survives.
Done when
- Finish then an immediate swipe back always lands on Home, in light and dark, on a phone.
- A widget test covers the window (fails before the fix, passes after).
- Changelog fragment for the app.

Activity
fix(app): Finish on the live transcript no longer pops Home after a s…