From 80250a8f2e4fd7c03bcb7ea95f5c2efa929b9c7f Mon Sep 17 00:00:00 2001 From: Tianyi Cui <53024+tianyicui@users.noreply.github.com> Date: Mon, 6 Jul 2026 01:53:44 +0800 Subject: [PATCH] workflow: drop the dead abandon-timer guard in drive()'s finally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The per-file branch gate caught it: drive()'s finally always cancels first, and every first cancel() arms the abandon timer, so the `!== undefined` guard's false arm was unreachable. clearTimeout tolerates undefined by contract — call it unguarded. --- packages/workflow/workflow-vm/src/runtime.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/workflow/workflow-vm/src/runtime.ts b/packages/workflow/workflow-vm/src/runtime.ts index af8a30927e..b2a117fdcc 100644 --- a/packages/workflow/workflow-vm/src/runtime.ts +++ b/packages/workflow/workflow-vm/src/runtime.ts @@ -265,8 +265,9 @@ export class WorkflowExecution { // their rejections from going unhandled.) if (this.cancelReason === undefined) this.cancel('workflow settled') // drive() settling means nothing is left to abandon — including the - // timer the self-cancel above just armed. - if (this.abandonTimer !== undefined) clearTimeout(this.abandonTimer) + // timer the self-cancel above just armed (cancel() always arms it, so + // it is never undefined here; clearTimeout tolerates undefined anyway). + clearTimeout(this.abandonTimer) } }