electron/lib
trop[bot] 585d4abdb6
fix: reset printToPDF queue after a rejection (#51220)
fix: reset printToPDF queue after a rejection

The module-scoped `pendingPromise` in `webContents.printToPDF` was chained
with `.then(onFulfilled)` and never cleared. Once a call rejected (e.g.
an out-of-range `pageRanges` like `"999"`), subsequent calls chained onto
the rejected promise and short-circuited without ever invoking
`_printToPDF` — so every following call re-surfaced the original error.

Replace the shared variable with a per-`WebContents` `WeakMap` queue that
swallows prior rejections before chaining and clears its entry once the
tail drains.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-04-21 15:31:08 -05:00
..
browser fix: reset printToPDF queue after a rejection (#51220) 2026-04-21 15:31:08 -05:00
common refactor: use WHATWG URL instead of url.parse (#50142) 2026-03-09 17:36:12 -04:00
isolated_renderer refactor: cleanup global variable declarations (#38410) 2023-05-24 20:01:07 +02:00
node fix: return numeric blksize and blocks from asar fs.stat (#50875) 2026-04-10 18:29:38 +02:00
preload_realm feat: service worker preload scripts for improved extensions support (#44411) 2025-01-31 09:32:45 -05:00
renderer fix: InspectorFrontendHost override in embedded windows (#50138) 2026-03-09 11:26:55 -04:00
sandboxed_renderer feat: add sharedTexture module to import shared texture (#48831) 2025-11-11 11:55:54 -05:00
utility build: drop @types/webpack-env in favor of webpack/module types (#47798) 2025-08-08 18:09:23 -07:00
worker fix: delete temporary blink* globals after restoring Blink implementations (#49999) 2026-03-02 13:13:11 -05:00