From 9d21601edf11b5a9c0ba31cb4f92e84f383bb824 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sat, 18 Jul 2026 16:28:12 +0200 Subject: [PATCH] fix: session persistence across restart Shutdown() was calling KillSession() which deleted the persisted JSON files immediately after saveAllSessions() wrote them. Now Shutdown() closes sessions directly without removing persistence files, allowing restoreAllSessions() to find them on next start. --- session/session.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/session/session.go b/session/session.go index 4451c6a..004bbf0 100644 --- a/session/session.go +++ b/session/session.go @@ -803,7 +803,15 @@ func (s *Manager) Shutdown() { } s.mu.Unlock() for _, id := range ids { - s.KillSession(id) + s.mu.Lock() + sess := s.sessions[id] + delete(s.sessions, id) + s.mu.Unlock() + if sess != nil { + sess.Cancel() + sess.Core.Close() + s.cfg.Log.Info("shutdown session %s", id) + } } }