Repository navigation
Handle document destruction during a hanging range request (issue 22051) - #22164
Conversation
Reference testsResults for 79dce90 (run, references from mozilla/pdf.js.refs@23d8c278ca).
The report is kept for 30 days and replaced by the next run. |
Codecov Reportβ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22164 +/- ##
==========================================
+ Coverage 90.34% 90.36% +0.02%
==========================================
Files 277 277
Lines 68030 68030
==========================================
+ Hits 61461 61477 +16
+ Misses 6569 6553 -16
Flags with carried forward coverage won't be shown. Click here to find out more. β View full report in Codecov by Harness. π New features to boost your workflow:
|
Viewer previewποΈ Viewer previews removed. |
There was a problem hiding this comment.
π‘ Changes recommended
Background range prefetch can produce an unhandled rejection during destruction.
2 open findings
What changed in this PR
Fixes document destruction while a range request is stalled.
Changes:
- Propagates aborted range-request failures.
- Defers cleanup so pending API calls can reject.
- Adds a regression test for issue 22051.
| File | Description |
|---|---|
src/βcore/βchunked_stream.js |
Changes request rejection handling. |
src/βcore/βworker.js |
Allows pending requests to settle before cleanup. |
test/βunit/βapi_spec.js |
Tests destruction during a hanging request. |
π§ Review effort: Balanced
π‘ Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
88630c7 to
9dce7c5
Compare
Also, avoid any "indirect" calls to `ChunkedStreamManager.prototype.#requestChunks` if loading has been aborted.
9dce7c5 to
79dce90
Compare


Also, avoid any "indirect" calls to
ChunkedStreamManager.prototype.#requestChunksif loading has been aborted.