Skip to content

Commit

Permalink
Do not trigger decipherabilityUpdate logic in the stream if cancelled
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Sep 14, 2023
1 parent 9050fc2 commit fc38766
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/stream/orchestrator/stream_orchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,13 @@ export default function StreamOrchestrator(
}, { clearSignal: orchestratorCancelSignal, includeLastObservation: true });

manifest.addEventListener("decipherabilityUpdate", (evt) => {
if (orchestratorCancelSignal.isCancelled()) {
return;
}
onDecipherabilityUpdates(evt).catch(err => {
if (orchestratorCancelSignal.isCancelled()) {
return;
}
currentCanceller.cancel();
callbacks.error(err);
});
Expand Down

0 comments on commit fc38766

Please sign in to comment.