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.


Backport of: #24277