fix(cloudflare): Call connect() on the binding for service bindings and DO stubs - #24593
Merged
Merged
Conversation
JPeer264
added this pull request to stack #24594
September 22, 2026 14:22
Member
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c0d0931. Configure here.
Contributor
size-limit report 📦
|
JPeer264
marked this pull request as ready for review
September 22, 2026 16:53
JPeer264
requested review from
andreiborza,
isaacs and
mydea
and removed request for
a team
September 22, 2026 16:53
Base automatically changed from
jp/cloudflare-queue-producer-metrics-binding
to
develop
September 23, 2026 07:21
…nd DO stubs The service binding and Durable Object stub proxies returned connect() unbound, so calling it ran the native method with the proxy as `this` and workerd threw "Illegal invocation". The proxies cannot bind every function, because reading `.bind` on an RPC method returns another RPC property, so only connect() is forwarded to the binding. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
JPeer264
force-pushed
the
jp/cloudflare-connect-binding
branch
from
September 23, 2026 07:21
c0d0931 to
c0611fe
Compare
Contributor
|
👋 @isaacs, @mydea, @andreiborza — Please review this PR when you get a chance! |
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.
Found while fixing #24590: the service binding and Durable Object stub proxies have the same problem with
connect(). It is returned unbound, soenv.SERVICE.connect()andstub.connect()throw "Illegal invocation" on an instrumented env, with or without RPC trace propagation.Unlike the Queue fix, these proxies cannot bind every pass-through function: reading
.bindon an RPC method returns another RPC property (ping.bind) and would break RPC calls. So onlyconnect()is forwarded to the binding.Local workerd rejects an incoming CONNECT on a Worker after the
thischeck, so the integration test can only assert that the service binding no longer throws "Illegal invocation". The Durable Object stub call succeeds end to end.🤖 Generated with Claude Code