mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed? - Querying a paused workflow returns a "rejected" response. - Added functional test. ## Why? Executing queries on a paused workflow may not provide the updated results since the server withholds events from the worker when a workflow is paused. This breaks the current expectation of read-after-write semantics of Query API. Ex: When a client sends a signal to the workflow and follows up with a query, the expectation is that the query result includes the effect of the signal. But for a paused workflow that guarantee cannot be provided. So we are failing the queries in a paused workflow for now. ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [x] added new functional test(s) --- > [!NOTE] > Queries against paused workflows now return QueryRejected with PAUSED status; adds a functional test to validate behavior. > > - **History API**: > - `service/history/api/queryworkflow/api.go`: When `mutableStateStatus` is `WORKFLOW_EXECUTION_STATUS_PAUSED`, return `QueryRejected` with status `PAUSED`. > - **Tests**: > - `tests/pause_workflow_execution_test.go`: Add `TestQueryWorkflowWhenPaused` to verify querying a paused workflow returns `QueryRejected` with `PAUSED` status. > > <sup>Written by [Cursor Bugbot]() for commit 0f9a8387b5868e289d4c0fbea7909935c1b4f5a9. This will update automatically on new commits. Configure [here]().</sup>