Skip to content

feat(cloudflare)!: Match rpcTracePropagationBindings case-insensitively - #23625

Open
JPeer264 wants to merge 1 commit into
jp/rpc-trace-propagation-targets-vitefrom
jp/rpc-trace-propagation-bindings-case-insensitive
Open

feat(cloudflare)!: Match rpcTracePropagationBindings case-insensitively#23625
JPeer264 wants to merge 1 commit into
jp/rpc-trace-propagation-targets-vitefrom
jp/rpc-trace-propagation-bindings-case-insensitive

Conversation

@JPeer264

Copy link
Copy Markdown
Member

rpcTracePropagationBindings matched binding names with stringMatchesSomePattern, which compares strings case-sensitively and calls test() on the regex as given. A target carrying the g or y flag is stateful through lastIndex, so it matched only every other binding lookup.

The bindings now go through matchesTracePropagationTargets, the same matcher tracePropagationTargets uses since #23534. It lower-cases both sides and drops the g/y flags before testing.

matchesTracePropagationTargets gained a requireExactStringMatch parameter for this, named after the same parameter on isMatchingPattern. Binding names need an exact string match, otherwise an entry of DB would also enable propagation for MY_DB.

The new integration suite lists the bindings as 'my_durable_object' and /^svc_/g while they are named MY_DURABLE_OBJECT, SVC_ALPHA and SVC_BETA. SVC_BETA is the binding a stateful g regex drops, because matching SVC_ALPHA already moved its lastIndex past the start of the string.

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.58 kB +0.02% +7 B 🔺
@sentry/browser (incl. Tracing + Span Streaming) 48.6 kB +0.02% +7 B 🔺
@sentry/browser (incl. Tracing, Profiling) 51.52 kB +0.02% +9 B 🔺
@sentry/browser (incl. Tracing, Replay) 88.05 kB +0.01% +7 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.45 kB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 92.75 kB +0.01% +5 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 105.45 kB +0.01% +6 B 🔺
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.46 kB - -
@sentry/browser (incl. Metrics) 29.51 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.43 kB - -
@sentry/react 30.31 kB - -
@sentry/react (incl. Tracing) 50.8 kB +0.02% +7 B 🔺
@sentry/vue 35.69 kB - -
@sentry/vue (incl. Tracing) 50.83 kB +0.02% +8 B 🔺
@sentry/svelte 28.59 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.08 kB +0.04% +15 B 🔺
CDN Bundle (incl. Logs, Metrics) 32.56 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.97 kB +0.04% +16 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) 72.98 kB - -
CDN Bundle (incl. Tracing, Replay) 86.58 kB +0.02% +15 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.46 kB +0.02% +16 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 92.34 kB +0.02% +12 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.27 kB +0.02% +13 B 🔺
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.71 kB +0.02% +23 B 🔺
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.26 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.4 kB +0.02% +23 B 🔺
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.36 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.14 kB +0.01% +23 B 🔺
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.81 kB +0.01% +23 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.84 kB +0.01% +23 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.5 kB +0.01% +23 B 🔺
@sentry/nextjs (client) 53.34 kB +0.02% +7 B 🔺
@sentry/sveltekit (client) 49.03 kB +0.02% +5 B 🔺
@sentry/core/server 65.08 kB -0.13% -79 B 🔽
@sentry/core/browser 52.38 kB +0.01% +2 B 🔺
@sentry/node 121.53 kB -0.21% -246 B 🔽
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.19 kB -0.04% -26 B 🔽
@sentry/node - without tracing 87.63 kB -0.35% -305 B 🔽
@sentry/aws-serverless 95.78 kB -0.35% -333 B 🔽
@sentry/cloudflare (withSentry) - minified 199.54 kB +0.03% +47 B 🔺
@sentry/cloudflare (withSentry) 495.98 kB +0.11% +527 B 🔺

View base workflow run

@JPeer264
JPeer264 force-pushed the jp/rpc-trace-propagation-bindings-case-insensitive branch from 5194115 to ecf53cc Compare August 26, 2026 09:18
@JPeer264
JPeer264 force-pushed the jp/rpc-trace-propagation-bindings-case-insensitive branch from ecf53cc to d82956a Compare August 26, 2026 10:54
`rpcTracePropagationBindings` matched binding names with `stringMatchesSomePattern`,
which compares strings case-sensitively and calls `test()` on the regex as given. A
target carrying the `g` or `y` flag is stateful through `lastIndex`, so it matched only
every other binding lookup.

The bindings now go through `matchesTracePropagationTargets`, the same matcher
`tracePropagationTargets` uses since #23534. It lower-cases both sides and drops the
`g`/`y` flags before testing.

`matchesTracePropagationTargets` gained a `requireExactStringMatch` parameter for this,
named after the same parameter on `isMatchingPattern`. Binding names need an exact
string match, otherwise an entry of `DB` would also enable propagation for `MY_DB`.

The new integration suite lists the bindings as `'my_durable_object'` and `/^svc_/g`
while they are named `MY_DURABLE_OBJECT`, `SVC_ALPHA` and `SVC_BETA`. `SVC_BETA` is the
binding a stateful `g` regex drops, because matching `SVC_ALPHA` already moved its
`lastIndex` past the start of the string.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/rpc-trace-propagation-bindings-case-insensitive branch from d82956a to 4d6c2e7 Compare August 26, 2026 11:48
@JPeer264

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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 4d6c2e7. Configure here.

@JPeer264
JPeer264 marked this pull request as ready for review August 26, 2026 14:44
@JPeer264
JPeer264 requested a review from a team as a code owner August 26, 2026 14:44
@JPeer264
JPeer264 requested review from andreiborza, chargome and isaacs and removed request for a team August 26, 2026 14:44
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.

1 participant