-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[wrangler] Fix self-bindings showing as not connected in dev #10915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[wrangler] Fix self-bindings showing as not connected in dev #10915
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
🦋 Changeset detectedLatest commit: 7230dfd The changes in this PR will be included in the next version bump. 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 |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
Fixes #8970 Self-bindings (service bindings where a worker binds to itself) were incorrectly showing as [not connected] in wrangler dev. This change detects self-bindings by comparing the service name to the worker name and always marks them as connected, since a worker is inherently connected to itself. - Modified print-bindings.ts to check for self-bindings before registry lookup - Added test for self-bindings showing as [connected] - Manually verified with workers-with-assets fixture Co-Authored-By: smacleod@cloudflare.com <smacleod@cloudflare.com>
The table column widths are dynamically calculated based on content length. The self-bindings test has longer binding names than other service binding tests, which causes wider column spacing in the output. Updated the snapshot to match the actual table formatting. Co-Authored-By: smacleod@cloudflare.com <smacleod@cloudflare.com>
79e025a to
7230dfd
Compare
|
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
|
Congratulations @devin-ai-integration[bot], the maintainer of this repository has issued you a holobyte! Here it is: https://holopin.io/holobyte/cmh98kx1800a6l8042nvrptz6 This badge can only be claimed by you, so make sure that your GitHub account is linked to your Holopin account. You can manage those preferences here: https://holopin.io/account. |
Fixes #8970.
This PR fixes self-bindings (service bindings where a worker binds to itself) incorrectly showing as
[not connected]inwrangler dev.The Problem:
When a worker has a service binding that references itself (same service name as the worker name), the connection status check in
print-bindings.tswould look up the service in the dev registry to determine if it's connected. For self-bindings, this could show as disconnected during startup or in cases where the worker hasn't registered itself yet.The Solution:
service === context.name[connected]since a worker is inherently connected to itselfTesting:
SELF) and with named entrypoints (NAMED)fixtures/workers-with-assetswhere theNAMEDbinding now correctly shows as[connected]Example Before/After:
Link to Devin run: https://app.devin.ai/sessions/70aa50c3e5164f23a2c0c8efecd919af
Requested by: smacleod@cloudflare.com