Repository navigation
Conversation
Preview deployments carry production's BLOB_READ_WRITE_TOKEN, so a POST to any preview wrote into production's Blob store. canStore() now refuses every write when VERCEL_ENV names an environment other than production, whatever token the deployment has; outside Vercel (tests, plain next dev) the token alone decides, as before. GET /api/heartbeat reports "persists" for the deployment it reaches, so a deploy can be checked with a GET instead of a POST. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l out of next dev A default `vercel env pull` writes production's Blob token into .env.local with no VERCEL_ENV, so the earlier "unset means allow" branch let a local `next dev` write into production. canStore() now needs VERCEL_ENV to be "production"; the project exposes system env vars and production's env carries it, and GET /api/heartbeat shows "persists": false if a deploy ever loses it. The README's production pull for read-waitlist now goes to .env.waitlist.local, which next dev doesn't load and .gitignore covers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… pulls into .env.local Only the three previews built on 2026-11-18 before 18:45 UTC carry production's Blob token; the docs dated the cutoff to the day. A .env.local from a production pull sets VERCEL_ENV=production, and next dev loads it, so the docs now say never to make one and to delete one, and a test fails if any doc pulls production into a file next dev loads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The doc guard now parses each `vercel env pull` command: it finds production pulls by -e, --environment or --environment=, takes the first positional argument as the file (default .env.local), and checks its basename against every file next dev loads; a self-test pins those forms. The docs name all four files and how to spot a production pull, the README explains a GET answer with no persists key, and two test titles no longer say a plain next dev stores nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What this does
Preview deployments of openmessage.ai carried production's
BLOB_READ_WRITE_TOKEN, so a POST to/api/waitlistor/api/heartbeaton any preview wrote into production's Blob store. A defaultvercel env pullalso writes that token into.env.local, so a localnext devcould do the same. With a change to one Vercel setting, new previews and anext devon a default pull now store nothing. A.env.localmade by a production pull still setsVERCEL_ENV=production, so the docs now say never to make one and to delete one.canStore(env)insite/lib/public-writes.mjslets the routes touch Blob only when the deployment has a token andVERCEL_ENVisproduction. Vercel setsVERCEL_ENVat build and at runtime, the project exposes system environment variables (autoExposeSystemEnvs: true), and production's env carriesVERCEL_ENV="production". A preview getspreview,vercel devgetsdevelopment, and a default development pull sets none, so all three store nothing.POST /api/heartbeatanswers{"ok":true,"persisted":false}, so the app doesn't retry, andPOST /api/waitlistanswers 503 with the "can't take sign-ups" message.GET /api/heartbeatnow also returns"persists", so a GET can check a deployment: production answerstrue, any other deploymentfalse, and code without the check (production today, and Rebuild openmessage.ai around verified claims #283's previews) sends nopersistskey.scripts/read-waitlist.mjsnow writes.env.waitlist.local, whichnext devdoesn't load and.gitignorecovers. A test parses everyvercel env pullinsite/README.md,CLAUDE.mdand the script's comment, and fails if one pulls production (-e,--environmentor--environment=) into a filenext devloads:.env,.env.local,.env.developmentor.env.development.local. With no file named, the pull writes.env.local. A second test pins those parsing cases.site/README.mddescribe this and the GET check.Vercel setting (changed 2026-11-18, outside git)
BLOB_READ_WRITE_TOKENnow targets Production and Development. A PATCH to the env record (editProjectEnv, body{"target":["production","development"]}) removed Preview and kept the value.vercel env rm BLOB_READ_WRITE_TOKEN previewwould have deleted the whole record, production included: CLI 56.2.1 sends a DELETE for the record whatever environment it names. To undo, PATCH the record'stargetback to all three.Env changes reach only new deployments. Of the 14 previews that existed when the setting changed, the three #283 built on 2026-11-18 before the change (17:14, 17:27 and 18:03 UTC) list
BLOB_READ_WRITE_TOKENamong their env names and run its write routes withoutcanStore. The 11 from March and April 2026 have no Blob token and no write routes. Vercel Authentication keeps the public off all of them. Until #283's three previews go, the docs keep "never POST to any preview".Tests
The Site Build check ran
bun run test(300 tests) andbun run buildon the locked versions at e4a637f, which merges #283's head 2bc905a (the later merge of e7f7498 changes one blog sentence); the merge kept #283's JSON Content-Type check, address character rules and messages besidecanStore.bun run testlast ran locally at fb22303 (180 tests, before the merge), on an installed tree behind the lockfile (next 16.4.0 against 16.4.6, @vercel/blob 2.8.1 against 2.8.2). The new tests:canStoretruth table;VERCEL_ENVset topreview,developmentor nothing never reach it, with production's token set, and the same requests on production write;VERCEL_ENVother thanproduction, unset included, and any mix of up to 12 heartbeat and waitlist requests, no request reaches Blob;@vercel/blobmocked, including the GET flag.With the
VERCEL_ENVcheck removed, or with an unsetVERCEL_ENVallowed through, the six new guard tests fail. No test posts to a deployment.After the production deploy
curl -s https://openmessage.ai/api/heartbeatshould return{"ok":true,"schema_version":1,"persists":true}. Afalsemeans production stopped storing heartbeats and sign-ups.🤖 Generated with Claude Code