temporalio / temporalio/sdk-typescript
[Bug] Throw on usage of Workflow APIs that modify state from non-replayable context
Nobody has claimed this yet.
- 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.acceptedorUpdateResponse.rejectedcommands); Math.random()anduuid4();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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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