DX-2588: complete bulk action coverage - #208
Merged
Merged
Conversation
CahidArda
reviewed
Aug 4, 2026
ytkimirti
force-pushed
the
DX-2588-support-all-bulk-actions
branch
from
August 4, 2026 15:12
8119d79 to
84aeb99
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to close remaining gaps between the QStash Workflow API and this workflow client by tightening workflow/DLQ typing and extending DLQ operations, with corresponding tests.
Changes:
- Introduces a shared
FailureFunctionStatetype and applies it across workflow logs and DLQ structures. - Extends
failureFunctionStatefiltering to support multiple values (OR semantics) and updates typings accordingly. - Adds
dlq.cancelFailureFunction({ dlqId })to cancel in-progress failure function calls (treating302as success) and adds tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/client/types.ts | Adds FailureFunctionState and reuses it in failure-function log typing. |
| src/client/filter-types.ts | Updates filter typing to allow multi-value failureFunctionState using FailureFunctionState. |
| src/client/dlq.ts | Adds cancelFailureFunction implementation and reuses FailureFunctionState in DLQ message typing. |
| src/client/dlq.test.ts | Adds tests for multi-value failureFunctionState filtering and for cancelFailureFunction. |
Suppressed comments (2)
src/client/dlq.ts:327
DLQResumeRestartOptionsis marked@deprecatedinsrc/client/types.ts, but this new public method references it in its parameter type. It’s better to type this parameter directly (or via a non-deprecated helper type) so users don’t see deprecation warnings when usingcancelFailureFunction.
async cancelFailureFunction({ dlqId }: Pick<DLQResumeRestartOptions<string>, "dlqId">) {
src/client/filter-types.ts:46
- PR description mentions adding
logs({ workflowRunIds })to fetch logs for a set of runs in one call, but the current clientlogsimplementation still only supports a singleworkflowRunIdvia legacy params /filter.workflowRunId(noworkflowRunIdssupport found insrc/client/index.ts). If bulk log fetching is intended in this PR, the API/types/tests forlogslikely still need to be updated to match the description.
/**
* Filter by the state of the failure function call. Supports multiple values:
* pass an array to match runs in any of the given states (OR semantics).
*/
failureFunctionState?: FailureFunctionState | FailureFunctionState[];
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…stency - Make cancelExpecting timeout configurable (default 10 s); pass 20 s for the workflowUrl exact-match tests, which use a separate index that can lag longer than the prefix index. Also raise their test timeout to 60 s to accommodate the wider polling window. - Add a 1 s sleep between the first (labelOne) and second (labelTwo) cancel in the multi-label test so the cancellation propagates to the labelTwo index before we assert cancelled: 0. Raise test timeout to 45 s accordingly. Co-authored-by: CahidArda <57228345+CahidArda@users.noreply.github.com>
…ount QStash made filter-based bulk cancel asynchronous (server-side "bulk action" registry). The cancelled field is now a snapshot of how many runs matched the filter when the action was registered, not how many were cancelled, and re-issuing the same filter dedups onto the in-flight action instead of sweeping again. The old helper summed counts across repeated identical cancels, which is meaningless under those semantics. Assert on the runs themselves instead: re-issue the cancel until every targeted run 404s, then check the untargeted ones are still live. Cancel by id stays synchronous and exact, so it is still asserted on counts and is used for cleanup.
CahidArda
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the remaining gaps between the QStash API and the workflow client.
logs({ workflowRunIds })— fetch logs for a set of runs in one call (serverworkflowRunsparam). Combinable withfilter.failureFunctionStatefilter now accepts multiple values and is typed asFailureFunctionStateinstead ofstring.dlq.cancelFailureFunction({ dlqId })— cancels an in-progress failure function call (DELETE /v2/workflows/dlq/callback/:dlqId). The server answers success with302and an empty body, so that status is treated as success.Related: upstash/qstash-js#274