temporalio / temporalio/sdk-typescript

[Bug] Throw on usage of Workflow APIs that modify state from non-replayable context

Open
#1,652 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
917
Forks
224
Avg merge
3d 16h
Merged PRs (30d)
43

Description

Describe the bug

The following APIs should throw if invoked from a query handler, an update validation handler, or other "read only" execution context:

  • Any API that may result in adding a command (except for the RespondToQuery, UpdateResponse.accepted or UpdateResponse.rejected commands);
  • Math.random() and uuid4();
  • setHandler(), `setDefaultSignalHandler(), and similar;
  • condition()
  • CancellableScope()

At the moment, usage of these APIs may result in either failure on completion (from Core) or NDE on subsequent workflow tasks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the workflow API implementations used by query handlers, update validation handlers, and other read-only execution contexts. Exercise the listed state-changing APIs, Math.random(), uuid4(), handler registration, condition(), and CancellableScope() from those contexts; done means each disallowed use throws immediately while the listed exceptions remain usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.