sdk-go
sdk-go copied to clipboard
Safer queries (and update validators)
Is your feature request related to a problem? Please describe.
Queries can start activities and such and they shouldn't
Describe the solution you'd like
- Allow query handlers to accept a context as the first parameter in a backwards compatible way
- Disallow that context to be used for execute activity
- Add
workflowcheck
static analyzer check to ensure query handlers do not do anything they aren't supposed to
This is obviously a non-trivial amount of work and low priority
This same restrictions should also apply to SideEffects
as well
see also https://github.com/temporalio/sdk-features/issues/177
Queries, and other read only contexts can no longer perform any mutating operations. Leaving this open because we could still add support for the static analyzer