Skip to content

Commit 2741124

Browse files
committed
fix: prevent forceEventTimeot from not working if a mockEvent gets called afterwards
1 parent 614380d commit 2741124

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/workflows-shared/src/context.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -562,11 +562,6 @@ export class Context extends RpcTarget {
562562

563563
const pendingWaiterRegistered = `${cacheKey}-pending`;
564564

565-
if (await this.#state.storage.get(`forceEventTimeout-${waitForEventKey}`)) {
566-
console.log("Forcing event timeout for", waitForEventKey);
567-
options.timeout = 0;
568-
}
569-
570565
const timeoutError = new WorkflowTimeoutError(
571566
`Execution timed out after ${ms(options.timeout)}ms`
572567
) as Error & UserErrorField;
@@ -624,7 +619,8 @@ export class Context extends RpcTarget {
624619
type: "timeout",
625620
})) ||
626621
(timeoutEntryPQ !== undefined &&
627-
timeoutEntryPQ.targetTimestamp < Date.now())
622+
timeoutEntryPQ.targetTimestamp < Date.now()) ||
623+
(await this.#state.storage.get(`forceEventTimeout-${waitForEventKey}`))
628624
) {
629625
this.#engine.writeLog(
630626
InstanceEvent.WAIT_TIMED_OUT,

0 commit comments

Comments
 (0)