Skip to content

fix(main): ignore ERR_ABORTED did-fail-load events in renderer recovery - #314

Open
HuangLeijiana wants to merge 1 commit into
dataelement:mainfrom
HuangLeijiana:pr/fix-main-ignore-aborted-navigation
Open

fix(main): ignore ERR_ABORTED did-fail-load events in renderer recovery#314
HuangLeijiana wants to merge 1 commit into
dataelement:mainfrom
HuangLeijiana:pr/fix-main-ignore-aborted-navigation

Conversation

@HuangLeijiana

Copy link
Copy Markdown
Contributor

Programmatic navigation switches (restart, recovery page, Safe Mode toggle, second-instance reopen) stop the in-flight load before loading the next URL, which Electron reports as did-fail-load with the numeric net error ERR_ABORTED (-3). The recovery handler treated every such event as a renderer loss: it issued an extra webContents.reload() that raced the navigation it just started and consumed the shared 3-reload budget, so a genuine crash later hit the throttled branch and surfaced the 'stopped responding' recovery UI over a healthy runtime.

openHarness already treats ERR_ABORTED as benign at the loadURL await site; mirror that here via a new isAbortedNavigationCode predicate and cover both the numeric-code and Error shapes with unit tests.

Programmatic navigation switches (restart, recovery page, Safe Mode
toggle, second-instance reopen) stop the in-flight load before loading
the next URL, which Electron reports as did-fail-load with the numeric
net error ERR_ABORTED (-3). The recovery handler treated every such
event as a renderer loss: it issued an extra webContents.reload() that
raced the navigation it just started and consumed the shared 3-reload
budget, so a genuine crash later hit the throttled branch and surfaced
the 'stopped responding' recovery UI over a healthy runtime.

openHarness already treats ERR_ABORTED as benign at the loadURL await
site; mirror that here via a new isAbortedNavigationCode predicate and
cover both the numeric-code and Error shapes with unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant