Skip to content

fix(cloudflare): Bind non-instrumented Queue methods to the underlying binding - #24591

Closed
rytkhs wants to merge 1 commit into
getsentry:developfrom
rytkhs:fix/cloudflare-bind-binding-methods
Closed

rytkhs wants to merge 1 commit into
getsentry:developfrom
rytkhs:fix/cloudflare-bind-binding-methods

Conversation

@rytkhs

@rytkhs rytkhs commented Sep 22, 2026

Copy link
Copy Markdown

instrumentQueueProducer wraps send and sendBatch and returns every other property from the Proxy unbound. Calling a native method it doesn't wrap, like Queue#metrics(), then runs it with the Proxy as this, and workerd throws Illegal invocation. Passed-through functions are now bound to the binding, as the Durable Object namespace/storage and Workers AI proxies already do.

Fixes #24590

…g binding

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@rytkhs
rytkhs marked this pull request as ready for review September 22, 2026 14:01
@rytkhs
rytkhs requested a review from a team as a code owner September 22, 2026 14:01
@rytkhs
rytkhs requested review from isaacs and mydea and removed request for a team September 22, 2026 14:01
@rytkhs

rytkhs commented Sep 22, 2026

Copy link
Copy Markdown
Author

Closing in favor of #24592, which has the same fix plus a workerd integration test. Thanks for the quick turnaround!

@rytkhs rytkhs closed this Sep 22, 2026
@JPeer264

JPeer264 commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Sorry haven't seen this one - I'll mention you on our contributors list. Thanks a lot though for opening up a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@sentry/cloudflare: Queue#metrics() throws "Illegal invocation" on the instrumented env

2 participants