Skip to content

Conversation

@penalosa
Copy link
Contributor

@penalosa penalosa commented Jun 6, 2025

Fixes #9238.

This PR reverts the workaround from #9246 and implements the proper fix for the TCP connection regression by adding the connect_pass_through compatibility flag to the globalOutbound worker.

Background

Changes

  1. Reverted the workaround: Used git revert d033a7da1 to cleanly remove Edmund's temporary fix
  2. Added the proper fix: Include compatibilityFlags: ["connect_pass_through"] in the outbound service worker configuration in packages/miniflare/src/plugins/core/index.ts:840

Impact


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • Wrangler / Vite E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because: only affects Miniflare internal worker configuration
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal implementation change, no user-facing API changes
  • Wrangler V3 Backport

🤖 Generated with Claude Code

@penalosa penalosa requested a review from a team as a code owner June 6, 2025 11:07
@changeset-bot
Copy link

changeset-bot bot commented Jun 6, 2025

🦋 Changeset detected

Latest commit: 21f899f

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

This PR includes changesets to release 5 packages
Name Type
miniflare Patch
wrangler Patch
@cloudflare/pages-shared 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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 6, 2025

create-cloudflare

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

wrangler

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

commit: 21f899f

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Claude forgot a changeset

@penalosa
Copy link
Contributor Author

penalosa commented Jun 6, 2025

The deleted test (packages/wrangler/src/__tests__/api/startDevWorker/startWorker.test.ts) was specifically testing the JavaScript injection workaround that we're removing. Since we now use the proper workerd compatibility flag fix, this test is no longer relevant. The CF-Connecting-IP functionality is already covered by the existing Miniflare tests.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the v3-maintenance branch with your changes. Thank you for helping us keep Wrangler v3 supported!

Depending on your changes, running git rebase --onto v3-maintenance main penalosa/use-new-compat-flag might be a good starting point.

Notes:

  • your PR branch should be named v3-backport-9506
  • add the skip-v3-pr label to the current PR to stop this workflow from failing

@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Jun 9, 2025
@penalosa penalosa mentioned this pull request Jun 16, 2025
9 tasks
penalosa and others added 7 commits June 16, 2025 15:50
…orker

Add the connect_pass_through compatibility flag to the outbound service worker
that strips CF-Connecting-IP headers. This resolves the TCP connection regression
that was introduced when using globalOutbound service with workerd's connect() API.

The connect_pass_through flag was added in workerd PR #4171 to fix the underlying
issue, allowing us to remove the JavaScript injection workaround and use the
cleaner global outbound approach.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…geset

- Add 'experimental' compat flag alongside 'connect_pass_through'
- Add changeset for the TCP regression fix
- The deleted test was specific to the workaround we're replacing
@penalosa penalosa force-pushed the penalosa/use-new-compat-flag branch from cb612f0 to 21f899f Compare June 16, 2025 14:52
@penalosa penalosa added this pull request to the merge queue Jun 16, 2025
Merged via the queue into main with commit 36113c2 Jun 16, 2025
31 of 36 checks passed
@penalosa penalosa deleted the penalosa/use-new-compat-flag branch June 16, 2025 15:11
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jun 16, 2025
@penalosa penalosa mentioned this pull request Jul 15, 2025
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Regression with TCP connections in 4.15.0

3 participants