Electron app.whenReady(): Handling Timeouts and Cancellation – Unresolved API Design Decision
0 reputation · 08 Nov 2025, 10:50 UTC
Goal
To determine how to introduce graceful cancellation or timeout behavior for Electron’s app.whenReady() promise, which currently resolves only when the framework finishes initialization and offers no built‑in timeout or cancellation mechanism.
Constraints
- The API signature is fixed:
app.whenReady(): Promise<void>with no parameters. - Typical workarounds involve wrapping the promise in
Promise.raceand handling rejections manually, which can lead to unhandled rejections if not carefully managed. - Electron’s release notes from v2.0.0 onward show no addition of timeout or cancellation options.
Unresolved Decision
It remains unclear whether the Electron core team will extend app.whenReady() to support a timeout or cancellation flag, or whether developers must continue to implement custom logic. This ambiguity affects how developers design robust startup flows that can recover from stalled initializations.
Specific Questions
- What are the recommended patterns for adding a timeout to
app.whenReady()without triggering unhandled promise rejections? - Is there an official or community‑approved way to cancel the
app.whenReady()promise once it has started waiting? - Does the Electron roadmap include any plans to expose a timeout or cancellation option for
app.whenReady(), or is this left entirely to application code?