diff --git a/reports/bounties/caprine103-pr2384-resume-20261005/README.md b/reports/bounties/caprine103-pr2384-resume-20261005/README.md index bec59567f5..e9e657c1e4 100644 --- a/reports/bounties/caprine103-pr2384-resume-20261005/README.md +++ b/reports/bounties/caprine103-pr2384-resume-20261005/README.md @@ -23,7 +23,7 @@ Only a real `powerMonitor` resume event requests recovery; ordinary focus change Each resume gets a new epoch. Suspend, a replacing main-frame navigation, or window close cancels pending recovery and its retry timer. A response from an older epoch cannot reload the current page. A newer resume arriving during an older check waits until that check settles before starting another check. Window close also removes this packet's power and navigation listeners. -Once connectivity is reported, the callback consumes its one pending recovery. It reloads only while the application is not quitting, the window and web contents are live, and a main-frame load is not already in progress. Reload itself keeps the existing PR's semantics. The connectivity library retains its own per-call behavior; this change does not cancel an already running network check. A check that never settles stalls later checks rather than permitting parallel checks. +Once connectivity is reported, the callback consumes its one pending recovery. It reloads only while the application is not quitting, the window and web contents are live, and a main-frame load is not already in progress. Reload itself keeps the existing PR's semantics. The connectivity library retains its own per-call behavior; this change does not cancel an already running network check. A check that never settles stalls later checks rather than permitting parallel checks. An exception outside the connectivity promise, including a failed Electron reload, cancels that recovery attempt through an outer catch. It does not escape as a rejected unawaited callback, and it does not start a reload retry loop; the existing manual reload remains available. The navigation listener uses Electron 29's documented deprecated positional `did-start-navigation` arguments. The exact [v29.0.1 API source](https://github.com/electron/electron/blob/v29.0.1/docs/api/web-contents.md) documents those arguments and `isLoadingMainFrame()`, `isDestroyed()` and `reload()`. diff --git a/reports/bounties/caprine103-pr2384-resume-20261005/resume.patch b/reports/bounties/caprine103-pr2384-resume-20261005/resume.patch index 1339d2ee45..47c4bcd21a 100644 --- a/reports/bounties/caprine103-pr2384-resume-20261005/resume.patch +++ b/reports/bounties/caprine103-pr2384-resume-20261005/resume.patch @@ -11,7 +11,7 @@ diff --git a/source/index.ts b/source/index.ts import updateAppMenu from './menu'; import config, {StoreType} from './config'; import tray from './tray'; -@@ -431,14 +432,88 @@ +@@ -431,14 +432,91 @@ const {webContents} = mainWindow; @@ -67,6 +67,9 @@ diff --git a/source/index.ts b/source/index.ts + webContents.reload(); + } + } ++ } catch { ++ // A failed Electron operation ends this attempt; manual reload remains available. ++ cancelResumeRecovery(); + } finally { + connectivityCheckRunning = false; + if (resumePending && canRecoverResume() && resumeRetry === undefined) { diff --git a/reports/bounties/caprine103-pr2384-resume-20261005/source/index.ts b/reports/bounties/caprine103-pr2384-resume-20261005/source/index.ts index 2ac370bda8..1af74ef36b 100644 --- a/reports/bounties/caprine103-pr2384-resume-20261005/source/index.ts +++ b/reports/bounties/caprine103-pr2384-resume-20261005/source/index.ts @@ -476,6 +476,9 @@ function createMainWindow(): BrowserWindow { webContents.reload(); } } + } catch { + // A failed Electron operation ends this attempt; manual reload remains available. + cancelResumeRecovery(); } finally { connectivityCheckRunning = false; if (resumePending && canRecoverResume() && resumeRetry === undefined) {