ref(core)!: Remove supportsNativeFetch export - #23719
Conversation
size-limit report 📦
|
4bf8c35 to
4a25c19
Compare
4a25c19 to
1c482b3
Compare
|
|
||
| export { spanStreamingIntegration } from './integrations/browserSpanStreaming'; | ||
|
|
||
| export { supportsNativeFetch } from './utils/supports'; | ||
| export type { XhrBreadcrumbData, XhrBreadcrumbHint } from './types/breadcrumb'; | ||
| export type { BrowserClientReplayOptions } from './types/browseroptions'; |
There was a problem hiding this comment.
Bug: The removal of supportsNativeFetch from public exports in @sentry/core/browser will break a test in httpclient.test.ts that spies on this function.
Severity: HIGH
Suggested Fix
Update the test in packages/browser/test/integrations/httpclient.test.ts. Either import supportsNativeFetch directly from its source file (../utils/supports) for mocking, or refactor the test to no longer depend on this removed public export.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: packages/core/src/browser-exports.ts#L15-L19
Potential issue: The function `supportsNativeFetch` has been removed from the public
exports in `packages/core/src/browser-exports.ts`. However, the test file
`packages/browser/test/integrations/httpclient.test.ts` still imports it from
`@sentry/core/browser` and attempts to create a spy on it using `vi.spyOn(SentryCore,
'supportsNativeFetch')`. After this change, `SentryCore.supportsNativeFetch` will be
`undefined`, causing the spy to fail and breaking the test suite. While internal usage
is unaffected, the test represents a consumer of the public API that will now fail.
Also affects:
packages/browser/test/integrations/httpclient.test.ts
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1c482b3. Configure here.
|
|
||
| export { spanStreamingIntegration } from './integrations/browserSpanStreaming'; | ||
|
|
||
| export { supportsNativeFetch } from './utils/supports'; |
There was a problem hiding this comment.
Public API removed without deprecation
Medium Severity
This was flagged because the review rules call out removal of publicly exported functions without a deprecation notice. supportsNativeFetch was a public export from @sentry/core and @sentry/core/browser with no @hidden or @deprecated tag. Similar helpers such as supportsFetch stay exported as deprecated, and the v11 migration guide does not list this removal.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 1c482b3. Configure here.
1c482b3 to
8d5c407
Compare
Pull Request is not mergeable
25b9834 to
afd4f14
Compare


Removes this export from core. It was only used by
HttpClientintegration to guard adding the fetch instrumentation, which should not be necessary (we do not do this for other places).