You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DX-2769: reject empty id in single-resource endpoints (#202)
* fix: reject empty id in single-resource endpoints (DX-2769)
* DX-2735: report failing step name via Upstash-Error-Step-Name header (#201)
* feat: report failing step name via Upstash-Error-Step-Name header
When a step throws during execution, attach the step name to the error and
surface it on the 500 error response via the Upstash-Error-Step-Name header
so Workflow Logs can show which step is being retried.
* feat: expose stepName on failed next-step logs
The server now reports the failing step name (from the Upstash-Error-Step-Name
header) on the "next" step log group. Surface it as an optional stepName field
in the logs response type.
* fix: change requestcatcher to httpstatus
* fix: update mock server URLs to use requestcatcher
* feat: expose labels array on DLQ messages
DLQMessage only surfaced the first label via the deprecated `label`
field, unlike WorkflowRunLog which already exposes the full `labels`
array. Add `labels: string[]` to DLQMessage (and PublicDLQMessage) and
mark `label` deprecated, matching the run-log type.
Adds a mocked test asserting both fields round-trip through dlq.list()
and a live test confirming a run triggered with label: [a, b] surfaces
label === a and labels === [a, b] on its DLQ message.
* fix: bump version
* fix: urls in the tests
* fix: harden step-name error annotation and header sanitization
- attachStepNameToError no longer throws on non-extensible/frozen errors,
so it can never mask the original failure
- sanitize the step name (strip control chars like CR/LF) before putting it
in the Upstash-Error-Step-Name header so an invalid value can't break the
500 response
* style: apply prettier formatting fixes to test files
* test: replace requestcatcher.com with centralized example.com constant
requestcatcher.com was failing live deliveries with TLS certificate
errors. Replace it with the IANA-reserved example.com (valid cert,
stable) and centralize the host into a single MOCK_DESTINATION_HOST
constant in test-utils, referenced everywhere instead of repeating
the literal. Examples define a local MOCK_DESTINATION_URL since they
can't import test-utils.
Also switch the triggerWorkflowDelete test from spyOn (which made a
real network call) to the local mockQStashServer utility, removing the
last external request dependency.
* fix: address review comments on empty-id validation (DX-2769)
- Validate every id in array/legacy forms of cancel() and DLQ
resume/restart/delete via a shared toNonEmptyIdArray helper, not just
the single-string overload, so cancel([""]) / delete([""]) fail fast
instead of sending a bulk filter the server treats as a collection op.
- assertNonEmptyId: use a falsy guard instead of id.length so a plain-JS
caller passing undefined/null gets a consistent QstashError rather than
a TypeError from reading .length.
- makeNotifyRequest: treat workflowRunId with an explicit undefined check
and validate it when provided (an empty string no longer silently
changes the request path).
- await the .rejects assertions inside mockQStashServer execute callbacks
so the rejection is actually asserted.
- add tests covering an empty string inside an id array for cancel and
DLQ delete.
0 commit comments