You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(worker): catch non-Promise thenables and hostile brand reads
Addresses both review comments on #357.
`bindQueryHandler` / `bindUpdateHandler`'s per-call sync guards used
`instanceof Promise` while the bind-time probe used `isThenable`. Standard
Schema types the async branch as `Promise<Result>`, but an implementation
may hand back any `PromiseLike` — that slipped past `instanceof Promise`,
and the helper then read `.issues` (undefined, i.e. "valid") and `.value`
(undefined) straight off the thenable, handing the handler an unvalidated
`undefined` instead of tripping `ContractMisuseError`. Both call sites now
share an `isAsyncValidation` helper that matches the probe's check and
detaches the thenable's settlement.
`_internal_declaredWorkflowName` read a symbol property off an arbitrary
module export, so a `Proxy` with a throwing `get` trap (or a throwing
getter) aborted the whole workflow-registration check with an unrelated
exception. The read is now guarded — anything that fails to yield a string
brand is simply "not a declared workflow".
Also fixes the red Integration Tests job: turbo ran the four
`test:integration` tasks in parallel, each spinning up its own Temporal +
Postgres testcontainer pair, and the contention pushed the client suite's
fixture setup past Vitest's 10s `hookTimeout` default. Serialize the task
(the workaround already documented in the PR description) and give the
integration projects a `hookTimeout` sized for fixture setup that opens
Temporal connections and builds a workflow bundle per worker.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments