Repository navigation
fix(conversations): Home pages past hidden runs; live tile is an open v3 window; day view hides what Home hides - #25721
Merged
Merged
Conversation
…v3 window - Page fill counts only hidden rows against a 512-row cap (was 64 reads of any kind) and grows refill batches through a hidden run. - /v1/conversations always reports the storage-row offset advance in X-Omi-Conversation-Page-Size, which released apps already add to their offset and compare with the page size, so they page past a hidden run with exact offsets. Adds X-Omi-Has-More and a lever-gated cursor parameter with X-Omi-Next-Cursor; the body stays a list. - /v1/conversations/live returns only a v3-derived, tile_state=live window whose last speech is within 30 minutes, from a 2h30m created_at lookback. - A date-only filter (Home's day view) keeps hide_home. Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
… of the router Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
) Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ce; live scan has room past legacy rows Panel review-20261118t205007-ac7d F1/F2/F3/F5. Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
Panel review-20261118t220943-d3d1 on #25721: - F1/F2: /v1/conversations/live reads v3 windows through the existing conversations_v3_derived_window index (v3_derived, finished_at >= now - 2h, started_at <= now + 5m), projected, pages of 20 up to 4, and serves the newest open, visible window. Newer legacy rows can no longer push it out. - F6: unbudgeted refill bound asserts the 64 cap; budgeted variant asserts 512. - F7: an offset charge that exhausts the budget returns has_more=false. - F8: home_membership import at module top. - F4: document that a full page reports has_more without a probe. Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level
added a commit
that referenced
this pull request
Nov 18, 2026
The background refresh used the body length as its offset advance and as its full-page test, so a refresh that crossed a run of hidden rows re-read rows on the next page and dropped older loaded rows. Use the server's storage count for both (#25721 review F3). Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
The v3 window index is ascending by finished_at, so the open window is the last row; a fixed 80-row read could miss it on a busy account (panel review-20261118t225349-8438 F1/F2). Page through the 2-hour window with a logged 1,000-row safety stop instead of adding a descending index. Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
… without progress Panel review-20261118t232445-75cd on #25721: - F1: the polled live read takes the recent 10-minute band first (an open window's finished_at is its latest speech) and widens to the 2-hour idle window only when that band has no live window, under one 200-row cap per call. Existing index only. - F2: a page fill that reads no row before the budget runs out reports has_more=false, matching the offset-charge path. Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
…live bands Panel review-20261118t235829-041e on #25721: - F1: the include_discarded scan reports has_more only when the page returned a row, so an exhausted budget cannot invite the same request. - F2: the wider live band excludes the recent band (finished_at < now - 10 min), so a poll never reads a recent window twice. - F4: the cap warning names the bound that applied. Failure-Class: FC-raw-page-limit-before-visibility-filter Co-Authored-By: Claude Opus 5.5 <[email protected]>
Panel review-20261119t003449-3d72 F1: page oldest to newest by an explicit
order_by('finished_at') rather than the implicit order of two range fields;
the v3 window index serves it.
Failure-Class: FC-raw-page-limit-before-visibility-filter
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 19, 2026
Git-on-my-level
added a commit
that referenced
this pull request
Nov 19, 2026
…s speech span and End (#25725) ## Summary This is the Flutter half of the v3 Home read-path fixes. It builds on the backend PR #25721, which already fixes paging for shipped builds without an app release. On top of that, this PR fixes two live-tile problems from the 2026-11-18 owner audit and two v3 QA bugs David reported (an endless live summary and the live row flapping). - **Home uses `X-Omi-Has-More` and the cursor.** - `ConversationPageHeaders` reads `X-Omi-Has-More` and `X-Omi-Next-Cursor`. - The Home provider ends paging only when the server says there is no more. Before, it ended on any page with fewer than 50 storage rows. - That covers a page the read budget cut short (`X-Omi-List-Truncated`). The server says more only when the cut page advanced, so the next request resumes past it rather than repeating it. Only an older server's cut page still ends paging (review-20261119t083457-7e6a F1). - It sends the cursor on the next page, together with the offset. An older server sends neither header, so the app keeps today's full-page rule and sends no cursor. - **The background refresh now advances by the storage count too** (`_fetchNewConversations`). It used the body length, so after a refresh crossed a hidden run, the next page re-read rows. Its "rows absent from the page are gone" rule also used the body length. A refresh page shortened by hidden rows therefore dropped every older loaded row until the next full fetch. That rule now treats a page as full when the server says there is more (or, from a server without the header, when its storage count is full). It covers only down to its oldest visible row, by `created_at`, the order pages are read in (#25721 review F3; #25725 review F3). - **The live tile's length is the speech so far.** It was now minus `started_at`, so the silence after the last words kept growing it. On the owner's account it showed "25m" while the detail showed "11s". It now goes through the same duration authority as the detail (`getDurationInSeconds`): the transcript span, or `finished_at - started_at` when the live read carries no transcript. For an open v3 window, `finished_at` is the server's last speech. - **End Conversation lives on the live conversation's page, not on Home** (David's direction). - It sits in the detail page's bottom bar, beside Ask Omi. The Home live row has no button, so Home stays uncluttered. - It calls `CaptureProvider.forceProcessingCurrentConversation()`, the same action as a pendant double-tap. - **It shows only on this phone's own capture.** The open window's transcript must hold a segment this phone captured. A v3 window copies its recordings' segments, ids included. - A live window from another device (say a desktop) while this phone also records shows no End. End would finalize this phone's capture, not the conversation on screen. - The check runs again at the tap. - Before the window's transcript has loaded, End stays hidden (#25725 review F1). - **It ends once.** The capture keeps its segments until the WAL drain finishes, so End stays on screen for a few seconds after the tap. Further taps are ignored instead of adding a second processing row and finalizing again, the way the pendant's double-tap gate works (#25725 review F2). Once the drain settles, End works again, so after a failed drain, where the capture keeps its segments, End is not left on screen but dead (review-20261119t083457-7e6a F7). - The bar (Ask Omi) now shows for a live window even before its transcript arrives. The live read is compact and carries no transcript; End joins once the transcript shows this phone's segments. - End is on both tabs: beside Ask Omi on Summary, and beside the player's round Ask button on Transcript. - **QA: tapping the live row no longer spins and then says "No summary available".** - Before, opening a conversation still in progress started a summary write: an 8 s on-open reconcile, then the stream, then up to 60 s of polling on a 409. When nothing came back, the page fell back to the generic empty summary. - Now an open v3 window (tile state `live`) starts no summary write. Its Summary tab shows one quiet line: "Summary when this conversation ends". - The detail page itself re-reads the conversation every 15 s (`LiveConversationRefresher`), whichever tab is open, one read at a time and only while it is in front. It keeps reading while the window is `live` or `transcribing`. Once the window is `writing`, the summary streams as before (#25725 review-20261119t075514-3bac F1). - Before this, the timer lived in the Summary tab. A live page opens on Transcript, where `TabBarView` never builds the Summary tab, so nothing re-read the conversation. - A window that ends with transcription still pending is `transcribing`. Its Summary tab now says "Transcribing…" (an existing key) and still starts no write. Before, the section was dropped at `transcribing` along with its re-read, so the page never saw `writing` or `done`. - One new l10n key, `conversationSummaryWhenItEnds`, is added to all 49 locales with `scripts/l10n.py`. - **QA: Home no longer swaps between the v3 live row and the pendant capture card.** - Before, the capture card was hidden only while `/v1/conversations/live` returned a row (`processing_capture.dart`, deferred on `v3Live != null`). Any gap brought the old red-dot card back: before the first window, between windows, or after a missed poll. - On v3 Home, a streaming capture now always shows as the live row. Until the server has a window, and between windows, a placeholder row with the live row's card, tile and breathing dot stands in. It reads the capture's own state ("Listening", "Paused" and so on) and opens the live transcript, as the card did. - An Omi call keeps its call card. A call marks the phone capture interrupted, which reads as streaming, so the placeholder now leaves calls out and the two never both show (panel F5). - **The live conversation's page, cleaned up** (David, from the 002 render): - **It opens on the Transcript tab**, where the content is. The Summary tab keeps the one quiet line. When the window ends, the page does not switch tabs under the reader. - **"Open transcript" is gone.** The Transcript tab does the same job. Its string (`episodeOpenTranscript`) was not new to this PR and stays, because the Home recording bar and the episode sections still use it. - **A live date chip.** "● Live · 11m" replaces the static date chip: a breathing dot plus the speech so far, through the same duration authority as the Home row, so the two agree. - **Header actions wait for the end.** Share is hidden while the conversation is live. Star stays. - **The ⋯ menu drops everything that writes, edits, shares or deletes an unfinished conversation:** Summary Template, Reprocess, Rename, Move to Folder, Visibility, Link Event, Copy Summary and Share Audio. - **Delete is hidden too.** The Home row already refuses delete and edits on a live window ("not deleted or edited while capture writes it"). - **Still offered:** Ask about this conversation, Search, Copy Transcript, Export Transcript, Recordings and the developer tools. - **Smaller items.** I removed the "so far" transcript snippet that the earlier revision put on the Summary tab, since the Transcript tab shows it. I did not change the Transcript tab's own heading chips ("Transcript · N speakers", "Select · Transcript"): they are not specific to live windows. - **The End label fits a 320-point screen** (panel F6). The button takes at most 45% of the bar, and a long translation scales down on one line. A 320-point test checks there is no overflow. The day page still counts returned rows. With the backend change, its pages re-serve some rows (they are deduped) but no longer stop at a hidden run. Moving it to the headers would change its fetcher type and every fake that uses it, so I left it out here. ## UI evidence       These are widget-test renders, made with synthetic data and real fonts, from `test/pages/conversations/home_v3_test.dart` with `V3_HOME_RENDER_OUTPUT` set. The row and the detail show the same length (11m). In these renders the transcript lines show as blocks. That is a test-engine artifact, not the app: the transcript's `RichText` sets no font family, and the test engine's default face draws boxes. A device shows the system font. Every other label uses the loaded SF fonts. ## Test plan - New `test/providers/conversation_home_has_more_test.dart`: - header parsing, and the fallback to the full-page rule; - a 30-row page marked has-more keeps paging, and the next request carries `offset=542&cursor=k1`; - an older server keeps the full-page rule and sends no cursor; - a refresh advances by the storage count (`offset=542` after a 30-row body); - a refresh page shortened by hidden rows keeps the older loaded rows. Both refresh tests fail without the fix; - refresh coverage follows `created_at`. A row created inside the refreshed range but started long ago, and absent from the page, is dropped; older rows stay. This test fails with the old `startedAt` boundary. - `test/pages/conversations/home_v3_test.dart`: - the live tile shows 11m (the speech span), not 20m (start to now), and does not grow over 3 more minutes; - Home shows no End button; - the live detail opens on Transcript with the live chip ("Live · 11m"), no Share, and End beside Ask Omi; - opened on Transcript, with the Summary tab never built, the page re-reads every 15 s through live and transcribing, then stops at writing. This test fails without the page-owned refresher; - its Summary tab shows the one line, no link, and no summary write; - its ⋯ menu has Search but no Reprocess, Summary Template, Copy Summary, Share Audio or Delete; - End calls the force-processing action once and disappears afterwards; a second tap while the drain is still running does not finalize again, and after a failed drain End works again; - on a 320-point phone, End fits in at most about half the bar, with no overflow; - End is hidden on a live window whose transcript holds none of this phone's captured segments. A unit test pins the ownership rule: a shared segment means mine; a foreign window, an unloaded transcript, or nothing captured means not mine; - with the pendant streaming and no window open, the placeholder row shows and the capture card does not. The next window's row replaces it. - `test/widgets/conversations_v3_widgets_test.dart`: - a live conversation shows "Summary when this conversation ends", opens no summary stream, reads nothing itself, and offers no transcript link. At transcribing it says "Transcribing…" and still opens no stream. When it turns to writing, the summary stream opens; - `LiveConversationRefresher` reads one at a time, skips while another route covers the page, keeps reading through transcribing, and stops at writing; - the existing summary-writing tests now run on a writing window, which is where the stream applies. - `test/providers/conversation_home_has_more_test.dart`: a budget-cut page keeps paging when the server says more, stops when it says no more, and an older server's cut page is never taken for a full one. - The existing conversation provider, list item and summary tab tests pass (see CI). Deferred from review-20261119t083457-7e6a (minor or nit; this PR has converged): - F2: pause the live re-read while the app is in the background. - F3: hide Reprocess while transcribing. - F4/F9: Siri Spotlight reconcile boundary by `created_at` (pre-existing). - F5: gate the refresher on the account's v3 answer. - F6: make the title read-only while live. - F8: advance the offset from a refresh after the user has paged. - F10: End label comment (FittedBox scales rather than ellipsizes). Line-Count-Exception: app/lib/backend/http/api/conversations.dart | 1609 -> 1623 | optional cursor and page-header callback on the two list readers; the header type lives in conversation_page_headers.dart Line-Count-Exception: app/lib/widgets/conversation_bottom_bar.dart | 1489 -> 1513 | the live branch of the detail bar: End beside Ask Omi on Summary and beside the player on Transcript, gated on the account's v3 answer; the button itself lives in live_conversation_end_button.dart Line-Count-Exception: app/lib/providers/conversation_provider.dart | 2350 -> 2372 | the server cursor field, the has-more rule at the three page sites, and the refresh's storage-count advance Failure-Class: FC-capture-session-window-read-as-content-duration 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This was referenced Nov 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A v3 smell audit (2026-11-18, prod at 9c88e7f, read-only, counts only) found that Home stops early for 48 of 648 v3-active owners (7.4%), leaving 37,540 visible rows unreachable. It also found a stale legacy row showing as a live tile, and a day view that shows rows Home hides. This PR fixes all three on the server, for the TestFlight builds already shipped, without an app release.
F1: Home stops at a run of hidden rows
discarded == False) still matcheshome_hiddenv3 windows and recordings, and readers drop them. Each page read at most 50 +_RULE_DISCARD_PAGE_SKIP_CAP= 64 rows. The cap counted every refill read, not only hidden rows. So a run of 64 or more hidden rows returned a short page.conversation_provider.dart:986/1379). The longest measured hidden run per owner is p99 93 and max 158. The product owner's run is 73 rows, so Home stopped after 16 rows.X-Omi-Conversation-Page-Sizeto its offset, and uses>= 50on that value forhasMore(conversation_provider.dart:985-986,1378-1379;conversations.dart:199;conversation_home_list.dart:52). The server only sent that header while it suppressed episode members.Fix
_PageFill) for the offset and cursor paths:_HIDDEN_ROW_PAGE_SKIP_CAP = 512, so the longest measured run (158) fits about 3 times over. Readers without a budget (full-document internal callers ofget_conversations) keep 64, so their worst case does not grow./v1/conversationsnow always sendsX-Omi-Conversation-Page-Size, set to the number of storage rows the page consumed. This is the amount the nextoffsetmust advance by. Released apps then:include_discarded=truekeeps its visible-row offset, and its header equals the page length.X-Omi-Has-More: true|false. It isfalseonly when the scan reached the end of the query. A short page caused by the cap, or a page cut by the budget, saystrue.cursorquery parameter, reusing theconversation_list_cursorlever code (100% on prod). With the lever on, the response carriesX-Omi-Next-Cursor, and a cursor that decodes replaces the offset. A malformed cursor falls back to offset, as before. The body is still a plain list. OpenAPI and the generated TS and Swift clients are regenerated (one optional parameter added).F3:
/v1/conversations/liveshowed a stale legacy rowIt returned the newest non-recording in-progress row. It did not require
v3_derived. #25719 (merged while this PR was open) added a 2-hour idle cap inutils/conversations/v3/live.py.Fix: the route no longer scans the general list. It reads v3 windows through the existing
conversations_v3_derived_windowindex (v3_derived ASC, finished_at ASC, started_at ASC), in the newdatabase/conversations_v3_live.recent_windows:v3_derived == True,finished_at >= now - MAX_IDLE(2 hours) andstarted_at <= now + 5 min. This is the same query shapeconversations_v3.py:284-288already serves..select()reads only the fields the route returns plus the visibility flags. No transcript blobs are downloaded.finished_at, so the newest window comes last, and a read cannot stop early once it finds the open one. Reading newest-first would need a new descending index, which this PR does not add. The tile is polled every 15 seconds, so the read works in two bands instead:finished_atis its latest speech, so a speaking window is almost always here, and this band holds only a few rows.finished_at < now - 10 minon the wider one), so no row is read twice.v3_live.activethen returns the newest row that isin_progresswithtile_state == 'live'and is not recording,home_hidden, deleted or discarded.A legacy in-progress row can never match, however new it is, and newer legacy rows can no longer push the open window out of a fixed-size scan.
F2: the day view showed rows Home hides
A date range turned off
hide_home. Decision: applyhide_hometo a date-only filter, rather than add a Home drill-in flag:include_discarded,sources,folder_id,starredand non-defaultstatuses./v1/conversations/countis unchanged. Its hidden-row subtraction withhide_homeand a date range would need a new composite index, and the day page does not call it.Not in this PR (owned elsewhere)
commit_projection/reconcile size fix.mark_newfix.Why the day-view change has no lever
Hiding the same rows in the day view that Home hides ships on, with no read lever. This repo's rule is to ship on by default and to add a flag only for real risk to users, data or cost:
hide_home=not reveal.Follow-up (deferred from review-20261119t003449-3d72)
has_more.recent_windowsagainst a zero page size. It is unreachable today.X-Omi-Has-More: truewith no cursor means fall back to offset paging.max_idleintoactive().Known limits (intended)
X-Omi-Has-More: true. It does not probe for a next row. When the query ends exactly on a page boundary, the client makes one extra request and gets an empty page. A probe would charge every full page one more read to avoid that rare, harmless request.include_discardedscan. That page returns empty withX-Omi-Has-More: false, because there is no position to resume from and an identical retry would stop at the same place.day_conversations_page.dart:133,159) and web (data.length === limit) do not, so a date range holding more than 512 consecutive hidden rows still stops early there. The longest measured run is 158, and the follow-up is to have those views readX-Omi-Has-More._fetchNewConversations) still advanced by body length in the shipped build. fix(app): v3 Home pages on server has-more and cursor; live tile shows speech span and End #25725 makes it use the storage count./v1/conversations/countwith a date range still counts hidden rows. Subtracting them needs a composite index that does not exist (see F2). For the record: macOSConversationRepository.swift:121-145pairs a date-filtered list with a date-filtered count. A day view there can therefore show a count above the rows listed, until that index is added.App release needed?
No. F1, F2 and F3 take effect for released and TestFlight builds as soon as this backend deploys. The cursor and
X-Omi-Has-Moreheaders are additive. Using them in Flutter is optional follow-up work.Test plan
backend/tests/unit/test_home_hidden_run_pagination.py, synthetic rows only. It mirrors the app's paging loop (offset += header,hasMore = header >= 50):home_hiddenor recording), then 100 visible. Every visible row is reached exactly once, in order, and each page reads at most page + cap rows.storage_rows=200. The next page starts exactly after it, with no re-served rows.has_moreand keeps paging to the end.has_more=false. A budget cut keeps its prefix and sayshas_more=true.hide_homestays on for a date range alone and turns off for each reveal filter.test_conversations_v3_contract.py, live route (fix(conversations-v3): the live read skips open rows idle past the window cap #25719's cases kept, with v3 rows):test_fsr_wq4_cursor.py(the cap counts hidden rows only) andtest_pending_bridge_read_budget.py:has_more: falsewith no reads.test_firestore_query_shapes, caller and runtime witnesses, index rules, query contract):_PageFill._run;recent_windowsis a registered driver covered by the existing v3 window index.UI-Evidence: none -- only regenerated API client types change (one optional query parameter on the conversation list); no screen changes
Line-Count-Exception: backend/database/conversations.py | 5257 -> 5292 | one shared hidden-row page fill replaces the two refill loops; its docstring states the storage-advance contract
Line-Count-Exception: backend/routers/conversations.py | 2909 -> 2919 | optional cursor query parameter and page-header wiring; the helpers live in utils/conversations/list_page_headers.py and utils/conversations/v3/live.py and the live query in database/conversations_v3_live.py
Failure-Class: FC-raw-page-limit-before-visibility-filter
🤖 Generated with Claude Code