Skip to content

[wrangler] Avoid stale remote binding sessions - #15142

Merged
jamesopstad merged 2 commits into
mainfrom
penalosa/fix-remote-binding-cache-collision
Aug 12, 2026
Merged

[wrangler] Avoid stale remote binding sessions#15142
jamesopstad merged 2 commits into
mainfrom
penalosa/fix-remote-binding-cache-collision

Conversation

@penalosa

Copy link
Copy Markdown
Contributor

Prevent fresh remote proxy sessions with the same Worker name from reusing a stale binding configuration.

Edge preview identifies the uploaded proxy Worker by its source. The previous per-DevEnv counter restarted at 1, so fresh sessions could upload identical proxy source despite having different bindings. Generate a UUID for every upload so each binding configuration receives a distinct artifact.

The counter-only baseline failed deterministically on the second fresh session with Binding "REMOTE_WORKER_B" not found. The UUID treatment passed 20 alternating fresh sessions, and this adds unit and E2E regression coverage.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: this fixes internal cache-busting behaviour without changing the public API.

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 30fcb2a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
wrangler Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-pool-workers Patch

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

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Aug 11, 2026
@workers-devprod
workers-devprod requested review from a team and FredKSchott and removed request for a team August 11, 2026 23:21
@workers-devprod

workers-devprod commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@ask-bonk

ask-bonk Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

The MF-Binding header is the correct mechanism used by the proxy server worker to route to the named binding. The test's direct fetch against the proxy connection string with MF-Binding: REMOTE_WORKER_A/B is a valid way to exercise the specific binding, and asserting "Hello from a remote worker" matches the deployed remote-worker.js response.

The PR is well-constructed: the fix is minimal and correct (replacing a per-instance counter with a globally-unique UUID to prevent edge-preview artifact reuse across fresh same-name sessions), the removed #bundleVersion field is cleanly gone, and both unit and E2E regression tests directly target the bug. Changeset targeting and API usage are correct. I found no logic bugs, security issues, or backward-compatibility violations.

LGTM

github run

@pkg-pr-new

pkg-pr-new Bot commented Aug 11, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15142

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15142

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15142

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@15142

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15142

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@15142

miniflare

npm i https://pkg.pr.new/miniflare@15142

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15142

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@15142

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@15142

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@15142

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@15142

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15142

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@15142

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15142

wrangler

npm i https://pkg.pr.new/wrangler@15142

commit: 30fcb2a

@petebacondarwin petebacondarwin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's give it a go!

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Aug 12, 2026
@petebacondarwin
petebacondarwin force-pushed the penalosa/fix-remote-binding-cache-collision branch from ae7a5fd to 30f7b02 Compare August 12, 2026 05:49
devin-ai-integration[bot]

This comment was marked as resolved.

penalosa and others added 2 commits August 12, 2026 11:20
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@petebacondarwin
petebacondarwin force-pushed the penalosa/fix-remote-binding-cache-collision branch from df5c186 to 30fcb2a Compare August 12, 2026 10:21
@jamesopstad
jamesopstad merged commit 3b02915 into main Aug 12, 2026
56 checks passed
@jamesopstad
jamesopstad deleted the penalosa/fix-remote-binding-cache-collision branch August 12, 2026 10:42
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants