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 Apr 11, 2023
1 parent 2e9b557 commit 692d857
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 @@ -201,7 +201,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 692d857

Please sign in to comment.