fix(diarization): clear stale speaker rows on reprocess so Participants pane matches (FR-SPK)

Reprocess re-diarizes and upserts the new labels but never deleted the old
ones, so get_meeting (Participants pane) kept returning the discarded run's
labels (e.g. 83) while the transcript showed the new 5. Clear the meeting's
speaker rows before finalize re-inserts the fresh set.
This commit is contained in:
iamdoubz
2026-07-13 20:09:03 -05:00
parent 0d263637df
commit b39352dbff
+11
View File
@@ -1814,6 +1814,17 @@ pub async fn reprocess_transcript(
}
let speakers = speaker_infos_from_segments(&segments, &speaker_names);
// Drop the previous run's speaker rows before re-inserting the fresh set:
// the old labels key to the discarded clustering, so leaving them stranded
// in the DB makes the Participants pane show ghosts (e.g. 83 old labels
// when the new transcript has 5). finalize_meeting below re-upserts
// `speakers`. (FR-SPK)
state
.store
.clear_speakers(&meeting_id)
.await
.map_err(|e| WaError::new("storage", e.to_string()))?;
let duration_secs = segments
.last()
.map(|s| (s.end_ms / 1000) as i64)