fix(v10/browser): Release the XHR virtualError once the request completed - #24307
Conversation
…pleted Backport of: #24277
size-limit report 📦
|
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 50233f0. Configure here.
|
|
||
| expect(inFlightRequest).toBeDefined(); | ||
| expect(firstRequest?.deref()).toBeUndefined(); | ||
| }); |
There was a problem hiding this comment.
Retention test misses proxy leak path
Medium Severity
The new regression test only drives the addEventListener branch, where removeEventListener already drops the handler that closed over virtualError. The leak this fix targets is the onreadystatechange proxy keeping that closure—and the prior request—alive. This test can pass without virtualError = undefined and may not lock in the fix. Flagged because the Testing Conventions in the review rules require a fix PR's test to fail without the change and pass with it.
Triggered by project rule: PR Review Guidelines for Cursor Bot
Reviewed by Cursor Bugbot for commit 50233f0. Configure here.
## Dependency Updates | Package | From | To | Type | | --- | --- | --- | --- | | `@sentry/cloudflare` | 10.74.0 | 10.75.0 | minor | | `@sentry/react` | 10.74.0 | 10.75.0 | minor | ## Release Notes <details> <summary><b>@<!---->sentry/cloudflare</b> (10.74.0 → 10.75.0)</summary> ### Important Changes - **feat(v10/effect): Capture errors through the Effect v4 `ErrorReporter` API ([#24445](getsentry/sentry-javascript#24445 On Effect v4, `Sentry.effectLayer` now registers a Sentry `ErrorReporter`. Failures that pass through `Effect.withErrorReporting`, `ErrorReporter.report` or the built-in HTTP and RPC reporting boundaries are captured automatically, with `ErrorReporter.ignore`, `ErrorReporter.severity` and `ErrorReporter.attributes` annotations respected. Nothing changes on Effect v3. ### Other Changes - feat(v10/core): Accept a `CollectBehavior` shorthand for `dataCollection.httpHeaders` ([#24339](getsentry/sentry-javascript#24339)) - fix(v10/browser): Release the XHR `virtualError` once the request completed ([#24307](getsentry/sentry-javascript#24307)) - fix(v10/browser-utils): Skip nullish LCP entries in vendored web-vitals ([#24349](getsentry/sentry-javascript#24349)) - fix(v10/bundler-plugins): Stamp debug IDs onto emitted source maps when `disable-upload` is set ([#24332](getsentry/sentry-javascript#24332)) - fix(v10/core): Don't instrument the SDK's own envelope requests ([#24276](getsentry/sentry-javascript#24276)) - fix(v10/nextjs): Only include emitted chunk directories in Turbopack sourcemap upload ([#24295](getsentry/sentry-javascript#24295)) - fix(v10/nitro): Import from nitro/h3 instead of h3 directly ([#24444](getsentry/sentry-javascript#24444)) - fix(v10/node-core): Don't recurse in logAndExitProcess on a broken stdio pipe ([#24353](getsentry/sentry-javascript#24353)) - fix(v10/nuxt): Detect Nitro version via the app's Nuxt dependency chain ([#24025](getsentry/sentry-javascript#24025)) - fix(v10/replay): Don't rewrite already-emitted nodes when syncing mirror attributes ([#23588] …[full notes](https://github.com/getsentry/sentry-javascript/releases/tag/10.75.0) </details> <details> <summary><b>@<!---->sentry/react</b> (10.74.0 → 10.75.0)</summary> ### Important Changes - **feat(v10/effect): Capture errors through the Effect v4 `ErrorReporter` API ([#24445](getsentry/sentry-javascript#24445 On Effect v4, `Sentry.effectLayer` now registers a Sentry `ErrorReporter`. Failures that pass through `Effect.withErrorReporting`, `ErrorReporter.report` or the built-in HTTP and RPC reporting boundaries are captured automatically, with `ErrorReporter.ignore`, `ErrorReporter.severity` and `ErrorReporter.attributes` annotations respected. Nothing changes on Effect v3. ### Other Changes - feat(v10/core): Accept a `CollectBehavior` shorthand for `dataCollection.httpHeaders` ([#24339](getsentry/sentry-javascript#24339)) - fix(v10/browser): Release the XHR `virtualError` once the request completed ([#24307](getsentry/sentry-javascript#24307)) - fix(v10/browser-utils): Skip nullish LCP entries in vendored web-vitals ([#24349](getsentry/sentry-javascript#24349)) - fix(v10/bundler-plugins): Stamp debug IDs onto emitted source maps when `disable-upload` is set ([#24332](getsentry/sentry-javascript#24332)) - fix(v10/core): Don't instrument the SDK's own envelope requests ([#24276](getsentry/sentry-javascript#24276)) - fix(v10/nextjs): Only include emitted chunk directories in Turbopack sourcemap upload ([#24295](getsentry/sentry-javascript#24295)) - fix(v10/nitro): Import from nitro/h3 instead of h3 directly ([#24444](getsentry/sentry-javascript#24444)) - fix(v10/node-core): Don't recurse in logAndExitProcess on a broken stdio pipe ([#24353](getsentry/sentry-javascript#24353)) - fix(v10/nuxt): Detect Nitro version via the app's Nuxt dependency chain ([#24025](getsentry/sentry-javascript#24025)) - fix(v10/replay): Don't rewrite already-emitted nodes when syncing mirror attributes ([#23588] …[full notes](https://github.com/getsentry/sentry-javascript/releases/tag/10.75.0) </details> --- *This PR was auto-generated by [catalog-update-action](https://github.com/brandhaug/catalog-update-action).* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>


Backport of: #24277