Repository navigation
fix(cloudflare): Do not add back channel integrations the user removed - #25585
Open
Conversation
isaacs
added this pull request to stack #25589
October 20, 2026 22:30
Contributor
size-limit report 📦
|
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 abb4fe2. Configure here.
isaacs
marked this pull request as ready for review
October 21, 2026 00:44
isaacs
requested review from
JPeer264 and
mydea
and removed request for
a team
October 21, 2026 00:44
isaacs
force-pushed
the
isaacschlueter/js-3974-cloudflare-adds-back-channel-integrations-the-user-removed
branch
from
October 21, 2026 01:07
17f3007 to
1ec6d31
Compare
isaacs
force-pushed
the
isaacschlueter/js-3974-cloudflare-adds-back-channel-integrations-the-user-removed
branch
from
October 21, 2026 01:13
1ec6d31 to
5097841
Compare
isaacs
force-pushed
the
isaacschlueter/js-3974-cloudflare-adds-back-channel-integrations-the-user-removed
branch
2 times, most recently
from
October 21, 2026 01:20
c661f9c to
e0a34f5
Compare
The `@sentry/cloudflare/vite` plugin stores an integration factory for each instrumented package when the package first runs. At `init()`, the SDK adds the stored factories to the defaults. A package that runs after `init()`, for example a driver loaded with a dynamic `import()`, emits `orchestrion.module-injected`, and the SDK then called `client.addIntegration(factory())`. That handler did not check the user's options, so it ignored each way to opt out: an `integrations` function that filtered the integration out, `defaultIntegrations: false`, and a custom `defaultIntegrations` list. The user got the integration back. For the AI integrations, that can turn prompt and response capture back on. Whether it happened depended on module load order. The handler now applies the rules that `init()` applies to the defaults: - If the user set `defaultIntegrations`, the SDK defaults are off, so the handler adds nothing. - If `integrations` is a function, the handler passes the late integration through it with `getIntegrationsToSetup` 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. Fixes #25576 Fixes JS-3974 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
isaacs
force-pushed
the
isaacschlueter/js-3974-cloudflare-adds-back-channel-integrations-the-user-removed
branch
from
October 21, 2026 04:14
e0a34f5 to
f20e973
Compare
This branch has not been deployed
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.
The
@sentry/cloudflare/viteplugin stores an integration factory for each instrumented package when the package first runs. Atinit(), the SDK adds the stored factories to the defaults. A package that runs afterinit(), for example a driver loaded with a dynamicimport(), emitsorchestrion.module-injected, and the SDK then calledclient.addIntegration(factory()).That handler did not check the user's options, so it ignored each way to opt out: an
integrationsfunction that filtered the integration out,defaultIntegrations: false, and a customdefaultIntegrationslist. The user got the integration back. For the AI integrations, that can turn prompt and response capture back on. Whether it happened depended on module load order.The handler now applies the rules that
init()applies to the defaults:defaultIntegrations, the SDK defaults are off, so the handler adds nothing.integrationsis a function, the handler passes the late integration through it withgetIntegrationsToSetupand 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.integrationsis an array, nothing changes. An array cannot remove a default, andaddIntegrationalready skips a name the user configured.Fixes #25576
Fixes JS-3974