Skip to content

feat: multi-value filters for bulk message cancel + multi-label schedules#271

Merged
CahidArda merged 9 commits into
mainfrom
multi-value-bulk-cancel-filters
Jul 14, 2026
Merged

feat: multi-value filters for bulk message cancel + multi-label schedules#271
CahidArda merged 9 commits into
mainfrom
multi-value-bulk-cancel-filters

Conversation

@CahidArda

@CahidArda CahidArda commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

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, 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.

…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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 add host/path filters where supported.
  • Update bulk filter payload construction to rename urlGrouptopicName while preserving array values.
  • Add schedule multi-label support via Upstash-Label header serialization and introduce labels on the Schedule type (with label deprecated).

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.

Comment thread src/client/flow-control.test.ts
Comment thread src/client/dlq.test.ts
Comment thread src/client/dlq.test.ts
Importing it from logs.test.ts made bun register logs tests when
running dlq/client/flow-control test files individually.
@CahidArda CahidArda merged commit 36bfde5 into main Jul 14, 2026
13 of 14 checks passed
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.

3 participants