Matthias Nott
2026-03-22 0b9d8a65740476ad40616cfd779963460999ff00
lib/providers/providers.dart
....@@ -92,9 +92,10 @@
9292
9393 /// Switch to a new session and load its messages.
9494 Future<void> switchSession(String sessionId) async {
95
- // Save current session before switching
95
+ // Force-flush current session to disk before switching
9696 if (_currentSessionId != null && state.isNotEmpty) {
9797 MessageStore.save(_currentSessionId!, state);
98
+ await MessageStore.flush();
9899 }
99100
100101 _currentSessionId = sessionId;