Repository navigation
Conversation
…s after reload The core watchdog has no stop, so every renderer left a 20 ms interval running for the life of the app and fired a false ANR once the renderer stopped polling. blur/focus used once, the debugger script map grew with every eval, and in protocol mode a reload gave the renderer a new id that main never mapped. Adds a stoppable watchdog with full listener cleanup on destroyed, disables it on render-process-gone, bounds the script map, and makes newProtocolRenderer resolve the id sent with the start request.
In protocol mode the reloaded page's visibility status can be dropped while its new id is still being mapped, and alive polls never change the enabled flag, so a disabled watchdog stayed disabled. suspend() holds the callback only until the next poll.
In protocol mode the request body is read asynchronously, so one status message from the crashed renderer can arrive after render-process-gone. A single poll must not lift the hold, or the watchdog fires a false ANR once that stale poll is the last one.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f31ecd8. Configure here.
…page A reloaded page sends its visibility once at start and the next poll only after a poll interval, so a block inside that interval was not reported. A visibility status cannot be a stale message from the crashed process, so it lifts the hold at once. The second-poll rule stays for protocol mode, where that status can be dropped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Each renderer with the event loop block integration left a 20 ms
setIntervalrunning for the life of the app, because the core watchdog has no stop. Once the renderer stopped polling, the leaked watchdog fired and, without stack capture, reported a false ANR and marked the session abnormal.blur/focuswere registered withonce, so hidden windows stayed watched after the first cycle. The debugger script map grew with everyeval. In protocol mode a reload gives the renderer a new id that main never mapped, so status messages were dropped, ANR detection died and events lost their renderer name.createWatchdoginsrc/main/watchdog.tsaddsstop(), called with full listener cleanup ondestroyed.blur/focususeon.render-process-goneonly disables the watchdog, since the debugger session survives a crash and the reloaded page re-enables it. The script map is cleared ondid-navigateand capped.newProtocolRenderertakes the id from thestartrequest and probes every webContents for it, replacing a stale mapping.Unit tests cover the watchdog. A scratch app in protocol mode against master vs this branch: an event after reload is tagged with the renderer name instead of
renderer, a block after reload yields an ANR with filenames instead of nothing, and closing the window leaves 0 watchdog intervals instead of 1. The "ANR Renderer Event" e2e times out locally on master too, so it needs CI.