fix: skip non-upload-triggered worker versions in skew-protection#1270
Merged
james-elicx merged 1 commit intoMay 18, 2026
Conversation
Worker versions created by metadata-only operations (e.g. Cloudflare API
secret updates with triggered_by=secret) do not include the static assets
bundle. Previously, such a version could be picked as the "latest" target
when replacing the "current" sentinel in the deployment mapping, causing
/_next/static/* requests to return 404 on past deployments.
listWorkerVersions now skips versions whose
metadata.annotations["workers/triggered_by"] is not in
{upload, version_upload}. Versions with no annotation are kept for
backward compatibility.
Closes opennextjs#1230
🦋 Changeset detectedLatest commit: 03c48e8 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 |
commit: |
james-elicx
reviewed
May 18, 2026
| const MS_PER_DAY = 24 * 3600 * 1000; | ||
|
|
||
| /** Worker-version trigger types that produce a full upload (assets + code). */ | ||
| const UPLOAD_TRIGGER_TYPES = new Set(["upload", "version_upload"]); |
Collaborator
There was a problem hiding this comment.
I wonder if rollback and promotion are valid options here... https://github.com/cloudflare/workers-sdk/blob/b27eb18de664e416316d50116e568513d08123eb/packages/wrangler/src/versions/list.ts#L106-L119
james-elicx
approved these changes
May 18, 2026
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.
Worker versions created by metadata-only operations (e.g. Cloudflare API secret updates with
triggered_by=secret) do not include the static assets bundle. Previously, such a version could be picked as the "latest" target when replacing the "current" sentinel in the deployment mapping, causing/_next/static/*requests to return 404 on past deployments.listWorkerVersionsnow skips versions whose metadata.annotations["workers/triggered_by"] is not in{upload, version_upload}. Versions with no annotation are kept for backward compatibility.Closes #1230