Repository navigation
Commit 850db9d
fix(common): remove abort listener on the abort path too in httpResource
httpResource registers an 'abort' listener on the resource's AbortSignal
to unsubscribe the underlying request when it's cancelled. The listener
was only removed from the subscription's own error/complete callbacks,
but calling sub.unsubscribe() directly - which is exactly what happens
when the listener itself fires - doesn't trigger those callbacks. So on
the one path where the signal actually aborts, the listener was never
removed.
Passing { once: true } lets the removal happen automatically once the
listener fires, covering that path without touching the existing
error/complete cleanup, which is still needed for the paths where the
request finishes without ever aborting.
This also happens to route around a real leak on affected engines: an
AbortSignal that's had any listener attached isn't garbage collected
until it fires. https://bugs.webkit.org/show_bug.cgi?id=298499
(cherry picked from commit 5128dec)1 parent cfa8967 commit 850db9d
1 file changed
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
| 302 | + | |
304 | 303 | | |
305 | 304 | | |
306 | 305 | | |
| |||
376 | 375 | | |
377 | 376 | | |
378 | 377 | | |
379 | | - | |
380 | | - | |
| 378 | + | |
| 379 | + | |
381 | 380 | | |
382 | 381 | | |
383 | 382 | | |
384 | 383 | | |
385 | | - | |
| 384 | + | |
386 | 385 | | |
387 | 386 | | |
388 | 387 | | |
| |||
0 commit comments