fix: persist session state after all restorations complete on restart

persistSessionState was called before the respawn controller was restored,
so respawnEnabled was always saved as false during recovery. Moved the
persist call to after all restorations (auto-compact, auto-clear, ralph,
respawn) are applied.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-22 21:13:23 +01:00
co-authored by Claude Opus 4.5
parent 8501dcbec5
commit 1c430e0cbd
+3 -1
View File
@@ -1990,7 +1990,6 @@ export class WebServer extends EventEmitter {
}
this.sessions.set(session.id, session);
this.persistSessionState(session);
this.setupSessionListeners(session);
// Restore Ralph tracking state (Ralph Wiggum settings) if it was saved
@@ -2043,6 +2042,9 @@ export class WebServer extends EventEmitter {
}
}
// Persist full state after all restorations are applied
this.persistSessionState(session);
// Mark it as restored (not started yet - user needs to attach)
console.log(`[Server] Restored session ${session.id} from screen ${screen.screenName}`);
}