GeezerVison is showing github.com — fix(desktop): clear activation renderer on render-process-gone by greglum · Pull Request #43766 · pingdotgg/t3code
Conversation
Problem
DesktopAppActivation attaches did-start-navigation and destroyed listeners on webContents in apps/desktop/src/app/DesktopAppActivation.ts, but omits render-process-gone (unlike apps/desktop/src/window/DesktopWebLinks.ts). When Electron's renderer process crashes, webContents remains registered, leaving in-flight activation requests to hang until the 15s timeout and dispatching subsequent activation requests to the dead renderer instead of queuing them.
Change
- Attach
webContents.on("render-process-gone", onUnavailable) alongside did-start-navigation and destroyed in apps/desktop/src/app/DesktopAppActivation.ts, and remove it symmetrically in detachRendererListeners.
- In-flight activation requests now settle immediately with
renderer-unavailable, and subsequent requests queue until the reloaded renderer calls setRendererReady(true). On non-recoverable crashes where DesktopWindow does not reload, queued requests settle at the 15s request-timeout rather than dispatching to a dead renderer.
- Extended
apps/desktop/src/app/DesktopAppActivation.test.ts with a real local-socket regression test covering render-process-gone, immediate renderer-unavailable failure, listener removal, post-crash queuing, and queue flush when setRendererReady(true) runs.
Scope
Only apps/desktop/src/app/DesktopAppActivation.ts (+2/-0 lines) and apps/desktop/src/app/DesktopAppActivation.test.ts (+114/-1 lines).
Verification
- Reasoning on base (
origin/main @ f08bafe07f): without the render-process-gone listener, before-crash waits until the 15s broker/test timeout instead of failing immediately with renderer-unavailable.
- Local socket test (
pnpm --filter @t3tools/desktop exec vp test run --reporter=verbose src/app/DesktopAppActivation.test.ts): 4/4 passed (438ms), verifying before-crash returns { ok: false, requestId: "before-crash", code: "renderer-unavailable" }, webContents.listenerCount("render-process-gone") === 0, after-crash activates and stays queued until setRendererReady(true), and setRendererReady(false) leaves 0 listeners.
pnpm run check:changed: passed (format 0.3s, lint 0.5s with 0 warnings/0 errors, knip 1/2 6.8s, knip 2/2 10.6s, typecheck across 2 packages 1.9s, test 4.6s with 4/4 passed).
pnpm run i18n:check: passed (i18n catalogs match the source in apps/web, apps/mobile, apps/desktop.).
- Not verified: a live Electron renderer crash in a packaged desktop window was not triggered manually; verified via
DesktopAppActivation.layer over a real local Unix socket with a synthetic render-process-gone event.
Implemented by Gemini 4 Neon in T3 Code; reviewed by GPT-6.2 Luna and Claude Fable 5.2.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
DesktopAppActivation listened for did-start-navigation and destroyed on webContents, but omitted render-process-gone. When Electron's renderer crashed, webContents remained registered, leaving in-flight activation requests to hang until the 15s timeout and dispatching subsequent requests to the dead renderer instead of queuing them.
Attach render-process-gone to clearRegisteredRenderer alongside did-start-navigation and destroyed, detach it in detachRendererListeners, and add a real local-socket regression test covering in-flight failure and post-crash queuing until setRendererReady(true). On non-recoverable crashes where DesktopWindow does not reload, queued requests settle at the 15s request-timeout rather than dispatching to a dead renderer.
coderabbitai
Bot
commented
Nov 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
Desktop activation now handles render-process-gone with its existing unavailable handler and removes that listener when detaching renderer listeners. An integration test checks the response to an in-flight request after a renderer crash and verifies listener cleanup.
Changes: Renderer crash handling
| Layer / File(s) |
Summary |
Crash listener handling apps/desktop/src/app/DesktopAppActivation.ts, apps/desktop/src/app/DesktopAppActivation.test.ts |
Desktop activation registers and removes a render-process-gone listener. The integration test checks that an in-flight request receives ok: false and renderer-unavailable after a crash, and that the crash listener is removed. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: Minimal · up to 5e0a2
-
This change makes activation requests fail fast with renderer-unavailable when the renderer crashes, instead of hanging or being sent to a dead renderer. It is small and covered by a regression test, and no merge-blocking risk is evident.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title "fix(desktop): clear activation renderer on render-process-gone" names the change: the desktop activation code now removes renderer state when the render-process-gone event fires. The raw su… |
| Description check |
 |
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the cause and the affected files. The Change section explains the listener add… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title "fix(desktop): clear activation renderer on render-process-gone" names the change: the desktop activation code now removes renderer state when the render-process-gone event fires. The raw summary and objectives confirm a render-process-gone listener was added in DesktopAppActivation.ts and removed in detachRendererListeners. The title is specific and conventional, and it matches the main fix.
Full details: Description check
-
Explanation
The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the cause and the affected files. The Change section explains the listener addition and its symmetric removal. The Scope section names the two changed files and their line counts. The Verification section lists the focused test command with 4/4 results, the check:changed and i18n:check runs, and what was not verified (a live Electron crash). The Scope section does not link an issue or explain why no issue is needed, which the template asks for. The Change section also lists a request for the same fix and a scope note that fits with the template's guidance. Overall the description is mostly complete.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 869ff0f and 5e0a21f.
Files selected for processing: 1
-
apps/desktop/src/app/DesktopAppActivation.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Evidence
Linux Electron desktop, fresh synthetic state, light theme, 1920×1080. The same driver confirmed baseline activation, crashed the renderer three times, made it busy, started activation A, killed its renderer 1.5 seconds later, then started B after another 0.5 seconds. Both recordings were inspected through the crash, results, and final recovery.
| Before |
After |
| 8994fe6db4 |
5e0a21f8ec |
| Desktop recording |
Desktop recording |
A returned request-timeout after 15.49 seconds, remaining pending about 14 seconds after SIGKILL. |
A returned renderer-unavailable about 60 ms after SIGKILL. |
| B was dispatched to the stale renderer and timed out. |
B was never dispatched before its deadline and timed out as expected. |
Both sides successfully opened proj-c after recovery. The activation-under-crash step begins around 41 seconds in Before and 44 seconds in After.
Driver · Before results and dispatch trace · After results and dispatch trace
Not shown:
- The short 500 ms recovery case and successful draining of a queued request before its deadline were not exercised; this reproduction used crash-loop backoff, and B reached its deadline.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|