Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Upgrade Upstash QStash and Workflow (#3939)

Steven Tey2c82c9ce069a
diff --git a/apps/web/lib/cron/verify-qstash.ts b/apps/web/lib/cron/verify-qstash.ts
index 4099d70b87..2f39085ec1 100644
--- a/apps/web/lib/cron/verify-qstash.ts
+++ b/apps/web/lib/cron/verify-qstash.ts
@@ -3,10 +3,7 @@ import { Receiver } from "@upstash/qstash";
import { DubApiError } from "../api/errors";
// we're using Upstash's Receiver to verify the request signature
-const receiver = new Receiver({
- currentSigningKey: process.env.QSTASH_CURRENT_SIGNING_KEY || "",
- nextSigningKey: process.env.QSTASH_NEXT_SIGNING_KEY || "",
-});
+const receiver = new Receiver();
export const verifyQstashSignature = async ({
req,
@@ -32,6 +29,8 @@ export const verifyQstashSignature = async ({
const isValid = await receiver.verify({
signature,
body: rawBody,
+ // Pass the region header for multi-region support
+ upstashRegion: req.headers.get("upstash-region") ?? undefined,
});
if (!isValid) {
diff --git a/apps/web/package.json b/apps/web/package.json
index 3ec800cab8..1554ede4ee 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -57,11 +57,11 @@
"@types/base-x": "^3.0.10",
"@types/bcryptjs": "^2.4.6",
"@types/buffer-crc32": "0.2.0",
- "@upstash/qstash": "^2.8.2",
+ "@upstash/qstash": "^2.11.0",
"@upstash/ratelimit": "^2.0.6",
"@upstash/redis": "^1.35.3",
"@upstash/vector": "^1.2.2",
- "@upstash/workflow": "^0.2.19",
+ "@upstash/workflow": "^1.3.0",
"@vercel/edge-config": "^0.4.1",
"@vercel/functions": "^3.4.3",
"@vercel/og": "^0.6.5",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 502d27673c..df4cecadbe 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -150,8 +150,8 @@ importers:
specifier: 0.2.0
version: 0.2.0
'@upstash/qstash':
- specifier: ^2.8.2
- version: 2.8.2
+ specifier: ^2.11.0
+ version: 2.11.0
'@upstash/ratelimit':
specifier: ^2.0.6
version: 2.0.6(@upstash/[email protected])
@@ -162,8 +162,8 @@ importers:
specifier: ^1.2.2
version: 1.2.2
'@upstash/workflow':
- specifier: ^0.2.19
- version: 0.2.19([email protected])
+ specifier: ^1.3.0
+ version: 1.3.0([email protected])
'@vercel/edge-config':
specifier: ^0.4.1
version: 0.4.1
@@ -1045,42 +1045,16 @@ packages:
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-GYXnGJTHRTZc4gJMSmFRgEQudjqd4PUN0ZjQhPwOAYH1yOAvQoG/Ikqs+HyISRbLPCrhbZnPKCNHuRU4OfpW0Q==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.0.0
-
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-fqhG+4sCVv8x7nFzYnFo19ryhAa3w096Kmc3hWxMQfW/TubPOmt3A6tYZhl4mUfQWWQMsuSkLrtjlWuXBVSGQA==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.23.8
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-de2v8gH9zj47tRI38oSxhQIewmNc+OZjYIOOaMoVWKL65ERSav2PYYZHPSPCrfOeLMkv+Dyh8Y0QGwkO29wMWQ==}
engines: {node: '>=18'}
peerDependencies:
zod: ^3.25.76 || ^4.1.8
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-qZMxYJ0qqX/RfnuIaab+zp8UAeJn/ygXXAffR5I4N0n1IrvA6qBsjc8hXLmBiMV2zoXlifkacF7sEFnYnjBcqg==}
- engines: {node: '>=18'}
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-m9ka3ptkPQbaHHZHqDXDF9C9B5/Mav0KTdky1k2HZ3/nrW2t1AgObxIVPyGDWQNS9FXT/FS6PIoSjpcP/No8rQ==}
engines: {node: '>=18'}
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-jK1IZZ22evPZoQW3vlkZ7wvjYGYF+tRBKXtrcolduIkQ/m/sOAVcVeVDUDvh1T91xCnWCdUGCPZg2avZ90mv3g==}
- engines: {node: '>=18'}
- peerDependencies:
- react: ^18 || ^19 || ^19.0.0-rc
- zod: ^3.23.8
- peerDependenciesMeta:
- zod:
- optional: true
-
'@ai-sdk/[email protected]':
resolution: {integrity: sha512-mLIgQuBdIX9gxCYQN3Pv/J8ARoFreIKYr/TVQtI+FwEzejuGFimTyhDln7UIBfrnm3Mpn1xENIWZfDfCRF7wkw==}
engines: {node: '>=18'}
@@ -1097,12 +1071,6 @@ packages:
zod:
optional: true
- '@ai-sdk/[email protected]':
- resolution: {integrity: sha512-3zcwCc8ezzFlwp3ZD15wAPjf2Au4s3vAbKsXQVyhxODHcmu0iyPO2Eua6D/vicq/AUm/BAo60r97O6HU+EI0+w==}
- engines: {node: '>=18'}
- peerDependencies:
- zod: ^3.23.8
-
'@alcalzone/[email protected]':
resolution: {integrity: sha512-3yWxPTq3UQ/FY9p1ErPxIyfT64elWaMvM9lIHnaqpyft63tkxodF5aUElYHrdisWve5cETkh1+KBw1yJuW0aRw==}
engines: {node: '>=14.13.1'}
@@ -5787,9 +5755,6 @@ packages:
resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}
- '@types/[email protected]':
- resolution: {integrity: sha512-xFdR6tkm0MWvBfO8xXCSsinYxHcqkQUlcHeSpMC2ukzOb6lwQAfDmW+Qt0AvlGd8HpsS28qKsB+oPeJn9I39jg==}
-
resolution: {integrity: sha512-eOIHzCUSH7SMfonMG1LsC2f8vxBFtho6NGBznK41R84YzPuvSBzrhEps33IsQiOW9+VL6NQ9DbjQJznk/S4uRA==}
@@ -6063,8 +6028,8 @@ packages:
resolution: {integrity: sha512-7qJHGxpQgQr9/vmeS1PktEwvNAF7TI4iJDi8Pu2CFZ9YUGHZH4fOP5TfYlZ4aVxfopnELiE4BS4FBjyK7V1/xQ==}
engines: {node: '>=16.0.0'}
- '@upstash/[email protected]':
- resolution: {integrity: sha512-gQMCs2YXmRJWGh28t3fsWuPTzGgVFVRBd4o5QeWM9l3HW8TMNwt1qzv5wtzzSlG7hv1ylEy/PQCznkxGcAwTfw==}
+ '@upstash/[email protected]':
+ resolution: {integrity: sha512-AfPPxsUeOJCrxMQ9dkh1RZL40wgxCsUNFkxrbBSomC3U4j4qKFRawU8sDK+dqqH+sZFUS1biVM4GK46d5Tg2Vg==}
'@upstash/[email protected]':
resolution: {integrity: sha512-Uak5qklMfzFN5RXltxY6IXRENu+Hgmo9iEgMPOlUs2etSQas2N+hJfbHw37OUy4vldLRXeD0OzL+YRvO2l5acg==}
@@ -6077,8 +6042,10 @@ packages:
'@upstash/[email protected]':
resolution: {integrity: sha512-ptQ9xnxtKqmpNK52PCcHCszlPOLxIBfjsv7ty8RoF95pkjctS9rSjTQ3Pl9bx5VFbpDj+0dMXw88WLt6swDkgQ==}
- '@upstash/[email protected]':
- resolution: {integrity: sha512-i3MoVV4XVaE1dhYBrSDGDlRGkB7gWuTjVcU4c/nnDIUzJWIfZdtjsH8FprfDG/RMS9PK51MtLg7SsUXxWtjD5g==}
+ '@upstash/[email protected]':
+ resolution: {integrity: sha512-bY6JRB6MmU9rESbdL8Dd5gs9U0/C6cWYfCwiM8wgqr2IIYBcUHSrP4aWTjDWf8g8AAa4EDmd6ZBqm4E7ecdXWg==}
+ peerDependencies:
+ zod: ^3.25.0 || ^4.0.0
'@vercel/[email protected]':
resolution: {integrity: sha512-NRIBwfcS0bUoUbRWlNGetqjvLSwgYH/BqKqDN7vK1g32p7dN96k0712COgaz6VFizAm9b0g6IG6hR6+hc0KCPg==}
@@ -6347,16 +6314,6 @@ packages:
resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==}
engines: {node: '>=8'}
- resolution: {integrity: sha512-dIE2bfNpqHN3r6IINp9znguYdhIOheKW2LDigAMrgt/upT3B8eBGPSCblENvaZGoq+hxaN9fSMzjWpbqloP+7Q==}
- engines: {node: '>=18'}
- peerDependencies:
- react: ^18 || ^19 || ^19.0.0-rc
- zod: ^3.23.8
- peerDependenciesMeta:
- react:
- optional: true
-
resolution: {integrity: sha512-OOo+/C+sEyscoLnbY3w42vjQDICioVNyS+F+ogwq6O5RJL/vgWGuiLzFwuP7oHTeni/MkmX8tIge48GTdaV7QQ==}
engines: {node: '>=18'}
@@ -7605,9 +7562,6 @@ packages:
resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
- resolution: {integrity: sha512-IayShXAgj/QMXgB0IWmKx+rOPuGMhqm5w6jvFxmVenXKIzRqTAAsbBPT3kWQeGANj3jGgvcvv4yK6SxqYmikgw==}
-
resolution: {integrity: sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==}
engines: {node: '>= 10.14.2'}
@@ -9676,11 +9630,6 @@ packages:
engines: {node: '>=6'}
hasBin: true
- resolution: {integrity: sha512-3QItJOXp2AP1uv7waBkao5nCvhEv+QmJAd38Ybq7wNI74Q+BBmnLn4EDKz6yI9xGAIQoUF87qHt+kc1IVxB4zQ==}
- engines: {node: ^18.0.0 || >=20.0.0}
- hasBin: true
-
resolution: {integrity: sha512-zd4dqFiXSYyant2WgSXAZ9+yYqilNVvragVNkNRn2IFZKgjyULNrKRznqN4Zon0MkLueCg+3QaPVCnDAVP20OQ==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -11841,9 +11790,6 @@ packages:
resolution: {integrity: sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==}
- resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==}
-
resolution: {integrity: sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==}
@@ -13718,19 +13664,6 @@ snapshots:
'@vercel/oidc': 3.0.5
zod: 4.3.5
- dependencies:
- '@ai-sdk/provider': 1.1.3
- '@ai-sdk/provider-utils': 2.2.8([email protected])
- zod: 3.25.76
-
- dependencies:
- '@ai-sdk/provider': 1.1.3
- nanoid: 3.3.11
- secure-json-parse: 2.7.0
- zod: 3.25.76
-
dependencies:
'@ai-sdk/provider': 3.0.0
@@ -13738,24 +13671,10 @@ snapshots:
eventsource-parser: 3.0.6
zod: 4.3.5
- '@ai-sdk/[email protected]':
- dependencies:
- json-schema: 0.4.0
-
'@ai-sdk/[email protected]':
dependencies:
json-schema: 0.4.0
- dependencies:
- '@ai-sdk/provider-utils': 2.2.8([email protected])
- '@ai-sdk/ui-utils': 1.2.11([email protected])
- react: 19.1.3
- swr: 2.2.5([email protected])
- throttleit: 2.1.0
- optionalDependencies:
- zod: 3.25.76
-
dependencies:
'@ai-sdk/provider-utils': 4.0.1([email protected])
@@ -13776,13 +13695,6 @@ snapshots:
optionalDependencies:
zod: 4.3.5
- dependencies:
- '@ai-sdk/provider': 1.1.3
- '@ai-sdk/provider-utils': 2.2.8([email protected])
- zod: 3.25.76
- zod-to-json-schema: 3.24.1([email protected])
-
'@alcalzone/[email protected]':
dependencies:
ansi-styles: 6.2.1
@@ -19531,8 +19443,6 @@ snapshots:
'@types/[email protected]': {}
- '@types/[email protected]': {}
-
optional: true
@@ -19846,7 +19756,7 @@ snapshots:
dependencies:
'@upstash/redis': 1.35.3
- '@upstash/[email protected]':
+ '@upstash/[email protected]':
dependencies:
crypto-js: 4.2.0
jose: 5.10.0
@@ -19863,14 +19773,10 @@ snapshots:
'@upstash/[email protected]': {}
dependencies:
- '@ai-sdk/openai': 1.3.24([email protected])
- '@upstash/qstash': 2.8.2
- zod: 3.25.76
- transitivePeerDependencies:
- - react
+ '@upstash/qstash': 2.11.0
+ zod: 4.3.5
'@vercel/[email protected]': {}
@@ -20236,18 +20142,6 @@ snapshots:
indent-string: 4.0.0
optional: true
- dependencies:
- '@ai-sdk/provider': 1.1.3
- '@ai-sdk/provider-utils': 2.2.8([email protected])
- '@ai-sdk/react': 1.2.12([email protected])([email protected])
- '@ai-sdk/ui-utils': 1.2.11([email protected])
- '@opentelemetry/api': 1.9.0
- jsondiffpatch: 0.6.0
- zod: 3.25.76
- optionalDependencies:
- react: 19.1.3
-
dependencies:
'@ai-sdk/gateway': 3.0.2([email protected])
@@ -21631,8 +21525,6 @@ snapshots:
-
@@ -24475,12 +24367,6 @@ snapshots:
- dependencies:
- '@types/diff-match-patch': 1.0.36
- chalk: 5.4.1
- diff-match-patch: 1.0.5
-
dependencies:
'@dmsnell/diff-match-patch': 1.1.0
@@ -27106,8 +26992,6 @@ snapshots:
-
dependencies:
parseley: 0.12.1