You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 908fa35
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cloudflare): Do not add back channel integrations the user removed (#25585)
The `@sentry/cloudflare/vite` plugin registers an integration factory
for
each instrumented package when the package first runs. A package that
runs after `init()`, for example a driver loaded with a dynamic
`import()`, emits `orchestrion.module-injected`, and the SDK then added
its integration without checking the user's options. So an
`integrations`
function that filtered the integration out, `defaultIntegrations:
false`,
or a custom `defaultIntegrations` list did not keep it out. For the AI
integrations, that can turn prompt and response capture back on, and
whether it happened depended on module load order.
The handler now applies the rules that `init()` applies to the defaults:
- If `defaultIntegrations` is set, the SDK defaults are off, so the
handler adds nothing.
- If `integrations` is a function, the handler passes the late
integration through it and installs the result with the same name, if
there is one. This calls the function again, once for each late
module. If the function throws, the handler skips the integration, so
the module load that emitted the event still works.
- If `integrations` is an array, nothing changes. An array cannot remove
a default, and `addIntegration` already skips a name the user
configured.
The Nuxt and SvelteKit Cloudflare SDKs always pass a
`defaultIntegrations`
list, which they build from the Cloudflare defaults. Under the first
rule
they lost every late integration, so the `nuxt-4-cloudflare` and
`sveltekit-cloudflare-pages` E2E tests got no `mysql` spans. These SDKs
now set the internal option `_extendsDefaultIntegrations` when they
build
the list, so the handler still adds late integrations for them. A list
the user passes still turns them off. We kept this option over moving
the
handler into a default integration, because a user who builds a list
from
`getDefaultIntegrations()` and filters it would then still get the
filtered integration back.
Fixes#25576
Fixes JS-3974
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0 commit comments