Repository navigation
Conversation
- Add the `serverFunctions.skewProtection` option. It is off by default. - Each production build gets an ID that both the client and server bundles share. A configured `buildId` replaces the random one. - The client sends its build ID with every server function call. - The server answers a call with a different build ID with 409 and does not run the function. - The client reloads the page once on that response. A second skew within 10 seconds rejects the call instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 8cf8ca9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
✅ Deploy Preview for solid-start-landing-page ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
A page loaded before a deploy keeps calling server functions with the old client code. If a function's arguments or return value changed, or the function was removed, the call fails or does the wrong thing. This adds an opt-in check that refuses such calls and reloads the page so it runs the new version.
Changes
serverFunctions.skewProtection. It is off by default and only applies to production builds.import.meta.env.START_BUILD_IDfor both the client and server environments. It is a random UUID per build, or the configuredbuildId. It is empty when the option is off or in dev, so the bundler drops the new code.X-Start-Buildwith every server function call.X-Start-Builddiffers from its own with409andX-Start-Skew: true, before the function is looked up or run. The response gets the defaultCache-Control: no-store.X-Start-Buildare not checked. This covers no-JS form submissions and pages built before the option was turned on.recordReload()from the route chunk reload code. A second skew within 10 seconds rejects the call instead, so a load balancer that mixes old and new instances does not cause a reload loop.The option is off by default because every deploy reloads every open page on its next server function call, even when that function did not change. Function IDs hash the file and the name, not the body, so a changed signature cannot be detected from the ID.
Testing
packages/start:tsc --noEmitpasses and all 278 unit tests pass.apps/fixtures/todomvcwithskewProtection: { buildId: "build-a" }. The ID is in both the client and server output. A real server function called withX-Start-Build: build-areturned200. The same call withbuild-oldreturned409withX-Start-Skew: true.🤖 Generated with Claude Code