feat: crash recovery overlay for unresponsive instances#7
Open
Teamingzooper wants to merge 1 commit into
Open
Conversation
When a WebContentsView's renderer process dies (OOM kill, V8 segfault,
page calling process.crash(), etc.), Nexus previously just showed a
blank/frozen view. Now an HTML overlay appears over the affected
instance with "Reload" and "Dismiss" buttons.
Implementation follows the same main→bus→IPC→renderer pattern as the
notification/sidebar sync fix:
- ViewService attaches `webContents.on('render-process-gone', …)` to
every view at creation time. Filters out clean exits. Emits a new
`view:crashed` bus event with {instanceId, reason}.
- IpcService subscribes to the bus event (alongside instance:activated)
and forwards to the main renderer window via `nexus:view:crashed`.
- preload.ts exposes `window.nexus.onViewCrashed(cb)`.
- Renderer store tracks `crashedInstances: Record<id, {reason}>` and
gets a `reloadCrashedInstance(id)` action that clears the flag,
activates the instance, and calls reloadActiveInstance. Failure to
reload re-flags with the new error.
- New CrashOverlay component mounted globally in App. Shows only when
the *active* instance is in the crashed map. Calls useOverlay() so
the underlying WebContentsView is suspended (moved offscreen) while
the overlay is visible.
- No auto-reload by design — crash loops are worse than a stuck panel.
178/178 unit tests still pass. Renderer + main builds clean. Manual
smoke: in a webview's devtools, type `process.crash()` — the overlay
should appear within ~200ms; Reload spawns a fresh renderer; Dismiss
hides the overlay and the user can switch to another instance.
This was referenced May 16, 2026
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.
Summary
When an embedded webview's renderer process dies (OOM kill, V8 segfault, malicious page calling `process.crash()`, a runaway memory leak), Nexus previously just showed a frozen view with no signal to the user. This PR adds an HTML overlay over the affected instance with Reload and Dismiss buttons.
Mechanism
Same main → bus → IPC → renderer pattern as the notification/sidebar sync fix:
Design choices
Test plan
No automated test — the same IPC integration gap as the prior PR. The change is small enough that manual smoke is the right level.
🤖 Generated with Claude Code