fix: avoid disabling CancellationScope storage one workflow disposal
#1868
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was changed
No longer call
AsyncLocalStorage.disablefor the stores used to track cancellation and update scopes.Why?
conditionwith timeout creates aCancellationScopeto perform the race between the sleep and the blocking condition srcCancellationScopeis canceledCancellationScopeis stored in aAsyncLocalStoragewhich falls back to the workflow cancellation scope if not in a context where there is an active store. srcworkflowModule.dispose()call to thedisposemethod for reusable VM workflowAsyncLocalStoragethat stores the cancellation tokens (src). Any subsequentgetStorecalls that happen before a newrunwill returnundefined.conditionscope is created, but before the scope is cancelled, then the workflow ends up get cancelled instead of theconditionscope.CancelledFailure: Workflow cancelled, but coming from the cancel inside of theconditionscope on this lineChecklist
Closes [Bug] Signal caused
conditionto fail withCancelledFailureon1.14.0#1866How was this tested:
Added failing integration test in first commit, second commit fixes the test.
Any docs updates needed?
N/A