DX-2596: feat: support qstash-js auto dev server#192
Open
ytkimirti wants to merge 14 commits into
Open
Conversation
When QSTASH_DEV is set, construct the default Receiver with devMode: true so qstash-js fills the well-known dev signing keys. Without this, workflow silently skips signature verification in dev mode because the env-var check fails. Also pass devMode: false on the dummy Client used by DisabledWorkflowContext so the auth dry-run never spawns the dev binary.
Spawns the QStash dev binary on port 8383 and verifies a full round trip: workflow's auto-built default Client publishes through the dev server with no real credentials, and workflow's auto-built default Receiver successfully verifies the resulting dev-server signature and rejects a tampered body. Modeled after src/dev-server/index.test.ts in qstash-js#262.
Temporary pin until qstash-js#262 publishes a stable release with the dev-server feature.
9d03a9c to
5c9ad58
Compare
9e78f55 to
1b14b20
Compare
…flare-workers and nextjs examples
1b14b20 to
cda9036
Compare
pin pnpm to v10 on node18 test
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.
Summary
Wires workflow's defaults into the QStash auto dev server feature (qstash-js#262). When
QSTASH_DEV=trueis set,serve()auto-builds a dev-modeReceiverso signature verification works against the dev binary's well-known dev signing keys with no real credentials.getReceiver: in dev mode, constructnew Receiver({ devMode: true })instead of returningundefined. Without this, workflow silently skipped verification because the env-var key check failed.DisabledWorkflowContext: passdevMode: falseon the dummy Client so the auth dry-run never spawns the dev binary.Backwards compatibility
No breaking changes.
devModereferences are confined to internal modules (getReceiver,DisabledWorkflowContext) and never leak into workflow's public.d.ts, so users on older@upstash/qstashsee no type errors regardless of whether they pass their own Client. Runtime behavior is unchanged whenQSTASH_DEVis unset — the new branch only fires under that env var.Notes
Temporarily pinned to a
@upstash/qstashCI snapshot until qstash-js#262 publishes a stable release.