fix(app): prevent Solid cleanNode crash on session switch#37832
Open
cyrasafia wants to merge 5 commits into
Open
fix(app): prevent Solid cleanNode crash on session switch#37832cyrasafia wants to merge 5 commits into
cyrasafia wants to merge 5 commits into
Conversation
This was referenced Jul 20, 2026
cyrasafia
marked this pull request as draft
July 20, 2026 03:03
cyrasafia
marked this pull request as ready for review
July 20, 2026 05:34
|
Please support me with my ZYRAXON-AI project. https://github.com/onelpawarai/ZYRAXON-AI.git |
cyrasafia
marked this pull request as draft
July 20, 2026 05:47
added 5 commits
July 21, 2026 18:20
1.18.3-8 moved the session-id keyed remount from the session panel up to the whole Page owner. Switching sessions still triggered Solid's cleanNode on the same owner twice, crashing at node.cleanups[i]() when an inner cleanup had already nulled cleanups. Remove every session-id keyed remount inside Page: keep SessionPage stable, keep WorkspaceSessionPage keyed only on scope+directory so TerminalProvider survives, and let MessageTimeline/SessionPanelFrame react to params.id without disposing. Session switches already reset view state (on(sessionKey)), autoScroll + scroll-to-bottom (on(params.id)), editor draft (restorePromptModel), and focus (on(params.id)); timeline messages, file tabs and review diffs are reactive on params.id/sessionKey. Also stop tracking the local AUR packaging files (.SRCINFO, PKGBUILD); they are build artifacts moved under tmp/aur (gitignored).
Add reentrant-disposal guards to cleanNode in solid-js 1.9.10: capture owned/tOwned/cleanups to a local, null the node field, then iterate. A cleanup or owned-child disposal can re-enter cleanNode on the same owner during a router transition, nulling the field mid-loop and crashing on the next index read.
cyrasafia
force-pushed
the
fix/legacy-session-refresh
branch
from
July 22, 2026 01:35
9a8716a to
13e731b
Compare
cyrasafia
marked this pull request as ready for review
July 22, 2026 01:35
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.
Issue for this PR
Closes #37534
Type of change
What does this PR do?
Fixes a freeze/crash when switching sessions in the desktop app. The crash manifested as an uncaught
TypeError: Cannot read properties of nullinside Solid'scleanNode, causing the UI to freeze and become unresponsive.Root cause: Solid's
cleanNodeiteratesnode.owned[],node.tOwned[], andnode.cleanups[]with a for-loop, then nulls the field after the loop. During a router transition (session switch), a cleanup or owned-child disposal can re-entercleanNodeon the same owner. The inner call nulls the field; the outer loop then readsnull[i]and crashes. This affects all Solid 1.9.x releases (including 1.9.14); the upstreamrunComputationpatch (#2046) included in this repo does not covercleanNode.Fix — two parts:
Drop all session-id keyed remounts (
session.tsx,app.tsx): The original approach used<Show keyed>on the session ID to refresh panel content on switch. This deepened the disposal tree during transitions, making the reentrant crash more likely. All session-id keyed remounts are removed —SessionPageandPagestay alive across switches; timeline messages, file tabs, and review diffs update reactively viaparams.id/sessionKey. View state resets are handled by existing effects (on(sessionKey)for store,on(params.id)for autoScroll/editor draft/focus).Guard
cleanNodeagainst reentrant disposal (patches/solid-js@1.9.10.patch): Extended the existing patch to captureowned/tOwned/cleanupsto a local variable and null the node field before iterating, so reentrant calls no longer read a nulled array. Covers all four dist files (dev.js,dev.cjs,solid.js,solid.cjs).Additional changes:
WorkspaceSessionPagekeyed only on scope+directory (not session ID) soTerminalProvidersurvives session switches — eliminates PTY 404 errors on switch.editor-dom.ts:setCursorPositionchecksparent.isConnectedto avoid writing a selection range into a detached editor.How did you verify your code works?
bun typecheckinpackages/appopencode-desktop-binlocally (1.18.4)cleanNodecrashbun install(guards present in all dist files and in the built bundle)Checklist