fix(workflows): omit undefined step config keys from bridge - #1416
Merged
sam-goodwin merged 1 commit intoAug 31, 2026
Merged
Conversation
The bridge reconstructed step config as `{ retries, timeout: undefined }`
when only retries was set. The engine merges config over its defaults with
a shallow spread, so the explicit undefined timeout overwrote the built-in
default and the timeout watchdog later crashed calling ms(undefined)
(TypeError: Cannot read properties of undefined (reading 'match')).
Omit keys that are undefined so a retries-only step keeps the engine
timeout default.
sam-goodwin
marked this pull request as ready for review
August 31, 2026 19:47
Contributor
|
I ran the tests, they pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
A
Cloudflare.Workflows.taskstep that declaresretriesbut notimeoutcrashes on the first attempt with:Root cause
WorkflowBridge.toWorkflowStepConfigreconstructs the config object before handing it to the nativestep.do:When only
retriesis set, this produces{ retries: {...}, timeout: undefined }— an explicitly presentundefinedkey.The local engine then merges step config over its defaults with a shallow spread:
so the explicit
timeout: undefinedoverwritesdefaultConfig.timeout("10 minutes"). The step's timeout watchdog subsequently callsms(config.timeout), andms(undefined)throws thereading 'match'error insideitty-time.Native
cloudflare:workerscallers never emittimeout: undefined(the key is simply absent), so this is specific to the Alchemy bridge.Fix
Omit keys that are
undefinedintoWorkflowStepConfig, so a retries-only step keeps the engine timeout default:Test
Adds a regression test in
WorkflowBridge.test.tsasserting the bridge passes{ retries }with notimeoutkey.Notes
alchemy-testlocally (existing test files fail withdescribe/test/hook called outside of a test file collectionin my environment), so CI verification is appreciated.undefinedvalues, which would make the engine resilient regardless of what the bridge passes.