Skip to content

fix(sync): converge speakers across jobs and follow bridged conversations - #19432

Merged
Git-on-my-level merged 11 commits into
mainfrom
fix/sync-speaker-labels-and-bridge-redirect
Sep 27, 2026
Merged

Git-on-my-level merged 11 commits into
mainfrom
fix/sync-speaker-labels-and-bridge-redirect

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Follow owner-scoped sync bridge tombstones on conversation detail reads and speaker assignments. The assignment transaction maps a retired speaker selection through its stable segment IDs, including the segment IDs sent by the shipped iOS app, then edits the survivor. Missing or deleted survivors remain inaccessible.
  • Let conversation-wide speaker resolution process legacy sync donor scopes and stamp old sync survivors without renumbering existing speaker IDs. Record anonymous early-exit reasons. When resolution is unavailable, the Flutter transcript shows provisional anonymous labels instead of turning each WAL chunk ID into another apparent participant.
  • Refresh the open Flutter detail after queued speaker edits, replace the retired list row, and route subsequent edits to the survivor ID.

Incident and cause

On 2026-09-27, independent WAL jobs appended to one roughly 20-minute conversation. Each chunk has its own speaker_id_scope; ConversationSpeakerIdAllocator intentionally allocates a new conversation-local number for each scope/provider label. The conversation-wide voice pass is supposed to reconcile them. Production logs show four successful reprocessing runs for that ID but no speaker-resolution result; the pre-change resolver did not log no_audio, unaligned_audio, or no_embeddings, so logs cannot identify the exact early gate. Legacy sync scopes were incorrectly rejected as unaligned. This patch admits those scopes and exposes future gate outcomes. Audio-free conversations remain unavailable and are displayed as such; this PR does not invent a voice match without audio evidence.

Another sync conversation was bridged at 11:42:17Z, while iOS continued sending eight speaker PATCHes to its retired ID at 11:43:33–50Z. The stored tombstone was treated as deleted by both the detail route and the assignment transaction, yielding 404. The survivor may renumber a donor's speaker_id, so simply substituting the survivor ID could label a different voice. The transaction now follows the bridge and selects by stable segment IDs.

The same account had live UUID conversations and sync conversations in the pendant window. Logs confirm nine successful Parakeet backfill jobs with 33 successful speech segments across the account's observed 11:35–11:45Z downloads. They do not link the live sessions' STT usage or exact audio spans to those jobs, so they do not establish a numeric duplicate-billing amount. Replaying a WAL against already transcribed live audio can consume STT compute twice; this PR leaves provider routing and paid STT input unchanged.

The per-UID sequencer (#19362, merged during this work) will reduce overlapping backfill job/bridge races, but cannot merge chunk-local speaker identities or make a retired ID in an already open shipped client work. A Parakeet-first live lane could change marginal provider cost and perhaps the number of live stubs; it does not remove the need for conversation-wide voice resolution, bridge redirects, or audio-level deduplication.

Failure class

Failure-Class: none

These are two concrete contracts: conversation-wide speaker identity requires aligned audio evidence, and a server-authored bridge alias must preserve the user's open conversation actions. The shared primitives are the speaker resolver's scope gate and the owner-scoped redirect/assignment transaction; route-only 404 special cases would not preserve the selected voice.

Product invariants

None selected by scripts/pr-preflight --suggest.

Line-Count-Exception: app/lib/providers/conversation_provider.dart | 1951 -> 1979 | reason: replace a retired sync donor with its survivor in the authoritative conversation and search list cache.
Line-Count-Exception: backend/database/conversations.py | 3099 -> 3166 | reason: keep redirect resolution and manual speaker writes in the existing conversation database authority, with transactional regression tests.
Line-Count-Exception: backend/routers/conversations.py | 2157 -> 2169 | reason: preserve the released detail and speaker-assignment routes while accepting the shipped app's segment IDs.

Verification

  • BACKEND_UNIT_TEST_FILE_LIST=.local/speaker-bridge-tests.txt BACKEND_PYTEST_WORKERS=4 bash backend/test.sh: 107 focused tests passed across five files, including the assignment route compatibility suite.
  • flutter test --no-pub test/widgets/transcript_test.dart test/unit/ui_format/speaker_names_test.dart test/providers/speaker_summary_refresh_test.dart test/widgets/name_speaker_sheet_test.dart: 38 tests passed.
  • Read-only Cloud Run logging for backend-sync-backfill, backend-sync, and backend; no Firestore user document or API reads.
  • OMI_PR_BODY_FILE=.local/pr-body-speakers-bridge.md make preflight: passed; pre-push ran 54 selected checks. CI status will be verified on the exact PR head.

@mintlify

mintlify Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
omi 🟢 Ready View Preview Sep 27, 2026, 1:10 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@Git-on-my-level
Git-on-my-level merged commit f5794bf into main Sep 27, 2026
69 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/sync-speaker-labels-and-bridge-redirect branch September 27, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant