electron/lib/browser
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
..
api fix: reset printToPDF queue after a rejection (#51221) 2026-04-22 12:32:47 +02:00
.eslintrc.json chore: add missing .eslintrc.json files to limit imports properly (#35719) 2022-09-20 13:25:33 -05:00
default-menu.ts fix: move Electron help menu links to default app only (#50859) 2026-04-09 15:13:32 -07:00
devtools.ts feat: service worker preload scripts for improved extensions support (#44411) 2025-01-31 09:32:45 -05:00
guest-view-manager.ts chore: bump chromium to 140.0.7281.0 (main) (#47616) 2025-07-14 13:42:37 -07:00
guest-window-manager.ts refactor: remove dead named-window lookup from guest-window-manager (#50497) 2026-03-26 11:46:12 -04:00
init.ts fix: better shortcut registration and app icon matching on Wayland (#50051) 2026-03-04 16:43:44 +01:00
ipc-dispatch.ts refactor: dispatch IPC messages from Session (#45452) 2025-02-17 16:36:28 -05:00
ipc-main-impl.ts build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
ipc-main-internal-utils.ts fix: strictly validate sender for internal IPC reply channels (#50126) 2026-03-09 10:33:07 +01:00
ipc-main-internal.ts feat: add WebContents.ipc (#34959) 2022-08-03 16:55:12 -07:00
message-port-main.ts fix: make sure classes in lib correctly implement Electron interfaces (#40291) 2023-10-25 14:02:15 -04:00
parse-features-string.ts fix: restrict window.open features to allowlisted BrowserWindow options (#50948) 2026-04-11 19:04:40 -07:00
rpc-server.ts refactor: replace webFrame.routingId with sync IPC (#47717) 2025-08-02 11:00:42 -04:00
web-view-events.ts chore: bump chromium to 140.0.7281.0 (main) (#47616) 2025-07-14 13:42:37 -07:00