Jelajahi Sumber

workflow: drop the dead abandon-timer guard in drive()'s finally

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.
Tianyi Cui 2 bulan lalu
induk
melakukan
80250a8f2e
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      packages/workflow/workflow-vm/src/runtime.ts

+ 3 - 2
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)
     }
   }