fix: prevent profile-switch transcription deadlock

This commit is contained in:
2026-09-16 15:00:49 +02:00
parent cbf854fb2a
commit 93eb3d4e98
5 changed files with 73 additions and 16 deletions
@@ -805,7 +805,9 @@ public sealed class MeetingRecordingCoordinator
run.RecordTranscriptActivity(segment, inactivityClock.Now);
if (!string.IsNullOrWhiteSpace(segment.Text))
{
await DismissInactivityPromptsForRunAsync(run, cancellationToken);
// Switching profiles holds the coordinator gate while draining this reader.
// Notification cleanup must not make transcript draining wait for that gate.
_ = DismissInactivityPromptsForRunAsync(run, run.CaptureCancellation);
}
}
}
@@ -814,19 +816,26 @@ public sealed class MeetingRecordingCoordinator
RecordingRun run,
CancellationToken cancellationToken)
{
await gate.WaitAsync(cancellationToken);
try
{
if (!ReferenceEquals(currentRun, run) || run.IsCaptureStopping)
await gate.WaitAsync(cancellationToken);
try
{
return;
}
if (!ReferenceEquals(currentRun, run) || run.IsCaptureStopping)
{
return;
}
await DismissInactivityPromptsAsync(cancellationToken);
await DismissInactivityPromptsAsync(cancellationToken);
}
finally
{
gate.Release();
}
}
finally
catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
{
gate.Release();
// Pending cleanup is no longer needed after this run stops capturing.
}
}