electron/lib
trop[bot] 35aea3afcc
fix: reset printToPDF queue after a rejection (#51221)
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-22 12:32:47 +02:00
..
browser fix: reset printToPDF queue after a rejection (#51221) 2026-04-22 12:32:47 +02:00
common refactor: use WHATWG URL instead of url.parse (#50143) 2026-03-09 19:58:45 -07: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 (#50876) 2026-04-10 12:15:26 +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 (#50137) 2026-03-09 10:00:28 -05:00
sandboxed_renderer feat: add sharedTexture module to import shared texture (#47317) 2025-11-07 09:50:28 +01: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 (#50117) 2026-03-08 00:05:08 -08:00