Skip to content

Deprecate async def queries and disallow most workflow operations in read-only context #351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

cretz
Copy link
Member

@cretz cretz commented Jul 18, 2023

What was changed

  • Deprecated async def queries
  • Raise a read-only-context error for doing anything invalid in a query (and it's also ready for update validators when we get there)

Checklist

  1. Closes [Feature Request] Warn/error on invalid query use #250

@cretz cretz requested a review from a team as a code owner July 18, 2023 12:35
@@ -566,7 +566,8 @@ Here are the decorators that can be applied:
* Return value is ignored
* `@workflow.query` - Defines a method as a query
* All the same constraints as `@workflow.signal` but should return a value
* Temporal queries should never mutate anything in the workflow
* Should not be `async`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just deprecate and send a warning

Copy link

@Quinn-With-Two-Ns Quinn-With-Two-Ns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, easier to do with no side effects

Copy link

@Quinn-With-Two-Ns Quinn-With-Two-Ns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, easier to do with no side effects

@cretz cretz merged commit a17c0ef into temporalio:main Jul 18, 2023
@cretz cretz deleted the read-only-workflow-context branch July 18, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Warn/error on invalid query use
2 participants