[world-vercel] Handle null key response from run-key API endpoint#1174
Conversation
…dpoint
The API endpoint now returns { key: null } instead of a 404 when a
deployment has no encryption key. Update fetchRunKey to accept the
nullable response and return undefined, signaling that encryption
is disabled for that workflow run.
🦋 Changeset detectedLatest commit: a902e18 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 25 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 50 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro Promise.all with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.race with 50 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (46 failed)mongodb (1 failed):
turso (45 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
✅ 📋 Other
|
There was a problem hiding this comment.
Pull request overview
Updates @workflow/world-vercel’s encryption key retrieval to tolerate the Vercel API’s new { key: null } response for deployments without encryption enabled, and adds test coverage for the new behavior.
Changes:
- Update
fetchRunKeyto acceptkey: string | nulland returnundefinedwhenkeyisnull. - Adjust Zod response schema to allow nullable keys.
- Add
fetchRunKeytests fornullkey, valid key, and non-OK HTTP responses.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/world-vercel/src/encryption.ts | Accepts nullable key from the API and returns undefined when encryption is disabled. |
| packages/world-vercel/src/encryption.test.ts | Adds unit tests covering fetchRunKey’s new null-key behavior and error handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Include Zod error details in the validation error message for better debugging - Move fetch mock restoration to afterEach to prevent mock leakage on test failure
Summary
fetchRunKeyto handle the new{ key: null }response from the Vercel APIGET /v1/workflow/run-key/:deploymentIdendpoint, returningundefinedto signal encryption is disabled for that workflow run.z.string().nullable()and the return type toPromise<Uint8Array | undefined>.fetchRunKeycovering the null key, valid key, and error response cases.Context
The Vercel API endpoint now returns
{ key: null }instead of a 404 when a deployment does not have an encryption key. Without this change,fetchRunKeywould throw a Zod validation error on thenullvalue.All callers already handle
undefinedas "no encryption" via the existingrawKey ? await importKey(rawKey) : undefinedpattern.