Repository navigation
feat: receipt wait reads only finished jobs, live words keep their connection, a stored End finds its row - #26357
Merged
Merged
Conversation
…ider stream is given back Flag vendor_recognizer_on_opened_app. A connection used to close after 20 s without audio, and the phone opened a new one on the next audio. A pendant sends nothing while it is quiet, so the phone reconnected after every pause, and the listen service counts new connections per signed-in user. Now the phone's connection stays open through silence. After 20 s without audio only the provider stream is closed (it gets 3 s to deliver its last words), and the next audio dials a new one on the same connection; lines stay timed in seconds of audio from the connection's first frame. A lost stream is replaced the same way instead of closing the connection; three failures in a row without a word still end it. The connection itself closes after 10 minutes without audio. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ow does not stay Flag end_open_conversation. When End is pressed before the server has a conversation for the speech since the previous End, the End is answered pending. The app then kept its Processing row until the 20-minute deadline, because the row could only be handed to a conversation that named the listening session's recording, and on the phone-file route none does. The conversation an End closed already carries that End's instant (v3_manual_cut_at); the conversation reads now serve it, and the app matches its finish row to the conversation whose cut equals the End time it sent. A pending acceptance keeps the 2-minute expiry, which clears the row and makes Home read its list once. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ed_note) With receipt_long_poll. A finished upload job leaves a note in Redis for an hour, written before its wake. The receipts wait reads job state only for a job a note or a wake names, and an expired wait answers without reading anything; the app status-polls a job the wait covers once a minute as a backstop. As built before, every start, wake and expiry of a wait re-read every listed job. Also updates the live-words flag description: silence keeps the connection. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
…connection and the End finish row Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
…and with capture active One event each time the app leaves the front after at least a second there, with two whole numbers of seconds: in front, and in front with capture active. In front is the lifecycle state resumed and nothing else; the listening connection's own report counts a background launch as foreground, so iPhone in-front time could not be measured. Not behind a flag: it is the baseline for pricing a live stream before any rollout. Nothing is stored on the phone. Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
…w-ups Failure-Class: none Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.
What changed and why
Three follow-ups to #26348, each behind a per-account flag of that change and inert for an account the flag is off for, and one new analytics event that is not behind a flag.
receipt_finished_note(new flag, used withreceipt_long_poll). As first built, the receipts wait re-read every listed job when a wait started, on every wake and when it expired, which is several times the reads of the status polling it replaces. Now a finished upload job leaves a note in Redis for an hour before its wake, the wait reads job state only for a job a note or a wake names, and an expired wait answers without reading anything. The app status-polls a job the wait covers once a minute as a backstop. On a test phone the reads from waits fell to one per finished upload.vendor_recognizer_on_opened_app: silence keeps the connection. A/v4/live-wordsconnection used to close after 20 s without audio, so a phone fed by a pendant reconnected after every pause, and the listen service counts new connections per signed-in user (shared with the capture connection). Now only the provider stream is given back after 20 s of silence and the next audio dials a new one on the same connection; the connection closes after 10 minutes without audio.end_open_conversation: a stored End finds its conversation. When End is pressed before the server has a conversation for the speech since the previous End, the End is answered pending and the app kept its Processing row until the 20-minute deadline. Conversation reads now serve the End instant the builder already stamps (v3_manual_cut_at, hidden from the published schema), and the app matches its row to the conversation whose cut equals the End time it sent; a pending acceptance keeps the 2-minute expiry.App Foreground Ended(analytics event, every account, no flag). One event each time the app leaves the front after at least a second there, with two whole numbers of seconds: in front, and in front with capture active. "In front" is the lifecycle stateresumedonly. The listening connection's own report counts a background launch as foreground, so time in the app could not be measured on iPhone; this number is the baseline for pricing a live stream before any rollout. Registered incontracts/analytics/events.jsonwith its consumers; nothing is stored on the phone.Change note:
backend/docs/listen_pusher_pipeline/changes/2026-11-26-receipt-note-live-words-connection-end-finish-row.md.Rollout
No rule exists for any of these flags at deploy.
receipt_long_pollshould be admitted for an account only together withreceipt_finished_note. Beforevendor_recognizer_on_opened_appis ramped beyond single accounts: the load balancer needs a path rule for/v4/live-words, the display stream has no plan-allowance check, and the server's one-connection-per-install map is per process.Known limits
receipt_finished_note: a failed upload leaves no note and no wake (the once-a-minute poll finds it). A lost note, Redis being down and the phone in the background are not tested.Conversation.model_dump()consumers carry the new key like the other v3 fields.Product invariants affected
app/lib/services/capture/empty_recording_notice.dartandapp/lib/services/wals/**change only behindend_open_conversation,receipt_long_pollandreceipt_finished_note. With the flags off, capture, upload and receipt handling take the same paths as before.How it was verified
backend/scripts/typecheck.sh0 errors;scan_async_blockers.pyno findings.flutter test(whole suite).Tests
backend/tests/unit/test_reliability_experiment_receipt_finished_note.py(12 cases),test_reliability_experiment_live_words.py(15),test_reliability_experiment_end_answer.py,test_client_processing_trust_boundary.py(the new model field is classified).test/utils/analytics/app_foreground_time_test.dart(9 cases),test/unit/receipt_waiter_test.dart,test/unit/sync_poll_storm_test.dart,test/providers/end_stored_finish_row_test.dart, two cases intest/pages/conversations/home_v3_test.dart.UI evidence
UI-Evidence: none -- the only visible change (the Processing row leaving sooner after an End) is behind a flag that is off for all accounts.
Failure class (fixes)
Failure-Class: none
Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 3272 -> 3285 | test seam and upload times for the receipt waiter beside the wait it feeds
Line-Count-Exception: backend/database/batch_pipeline_projection.py | 1569 -> 1570 | one flag-gated call beside the wake it precedes
Line-Count-Exception: backend/routers/sync.py | 4281 -> 4297 | the note read inside the receipts wait route
🤖 Generated with Claude Code