feat: multi-value filters for bulk message cancel + multi-label schedules#271
Merged
Conversation
…ules
Add multi-value filter support to the bulk message cancel endpoint and
multi-label support to schedules, mirroring the QStash API changes.
Bulk message cancel (`messages.cancel({ filter })`):
- `url`, `urlGroup`, `queueName`, `scheduleId`, `flowControlKey` and
`callerIp` filters now accept `string | string[]`. A message matches if
its value equals any of the given values (OR logic); separate filters are
combined with AND logic.
- Add new `host` and `path` filters (destination URL host/path), each
supporting multiple values.
- `renameUrlGroup` handles array `urlGroup` values when mapping to `topicName`.
Schedules (`schedules.create`):
- `label` accepts `string | string[]`; arrays are sent as a comma-separated
`Upstash-Label` header. Added `labels` to the `Schedule` type and deprecated
the singular `label`.
Tests added for multi-value filter pass-through (incl. host/path and
urlGroup→topicName) and multi-label schedule creation.
…ests Widen the shared filter types so multi-value filtering (pass an array to match any value, OR semantics) is available on the DLQ and logs endpoints too, not just bulk cancel: - `url`, `urlGroup`, `scheduleId`, `queueName`, `callerIp` and `flowControlKey` now accept `string | string[]` across DLQ, logs and cancel. - `host` / `path` destination filters are shared by cancel and logs (verified against the live server; the DLQ endpoint rejects them, so its type omits them). Live integration tests (real QStash) verifying the behaviors: - messages.cancel: by multiple flowControlKeys, by path (single + multi), and by host (discriminating). - logs: by multiple urls (OR) and by host/path. - dlq: by multiple urls (OR, discriminating). Plus mocked URL-shape tests asserting repeated query-param serialization.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SDK support for new QStash API capabilities: multi-value filtering for bulk message cancellation (including host/path) and multi-label schedules, with corresponding type updates and tests to validate payload/query/header serialization.
Changes:
- Extend cancel/DLQ/log filter types to allow multi-value (
string | string[]) fields and addhost/pathfilters where supported. - Update bulk filter payload construction to rename
urlGroup→topicNamewhile preserving array values. - Add schedule multi-label support via
Upstash-Labelheader serialization and introducelabelson theScheduletype (withlabeldeprecated).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/client/utils.ts | Allows urlGroup to be string[] and forwards it as topicName in bulk filter payloads. |
| src/client/utils.test.ts | Adds unit tests ensuring array filters pass through and urlGroup maps to topicName for arrays. |
| src/client/schedules.ts | Serializes `label: string |
| src/client/schedules.test.ts | Adds a mocked test asserting multi-label schedule creation sends the correct header. |
| src/client/messages.ts | Documents multi-value filter semantics for messages.cancel. |
| src/client/messages.test.ts | Adds integration tests covering OR semantics and new host/path cancel filters. |
| src/client/logs.test.ts | Adds integration + mocked tests for multi-value url and host/path log filters as repeated query params. |
| src/client/flow-control.test.ts | Makes reset-rate test more robust via pause + retry loop; introduces a shared eventually helper import. |
| src/client/filter-types.ts | Updates filter types/docs to support multi-value fields and introduces host/path filters for cancel/logs. |
| src/client/dlq.test.ts | Improves DLQ test robustness with eventually and adds multi-value URL filter coverage + mocked query-param assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alitariksahin
approved these changes
Jul 13, 2026
Importing it from logs.test.ts made bun register logs tests when running dlq/client/flow-control test files individually.
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.
https://linear.app/upstash/issue/DX-2825/qstashworkflow-multi-value-cancel-etc
Add multi-value filter support to the bulk message cancel endpoint and multi-label support to schedules, mirroring the QStash API changes.
Bulk message cancel (
messages.cancel({ filter })):url,urlGroup,queueName,scheduleId,flowControlKeyandcallerIpfilters now acceptstring | string[]. A message matches if its value equals any of the given values (OR logic); separate filters are combined with AND logic.hostandpathfilters (destination URL host/path), each supporting multiple values.renameUrlGrouphandles arrayurlGroupvalues when mapping totopicName.Schedules (
schedules.create):labelacceptsstring | string[]; arrays are sent as a comma-separatedUpstash-Labelheader. Addedlabelsto theScheduletype and deprecated the singularlabel.Tests added for multi-value filter pass-through (incl. host/path and urlGroup→topicName) and multi-label schedule creation.