Skip to content

Commit f341310

Browse files
authored
fix(storage): prevent event loss during conversation moves (#361)
Ensure that conversation events are eagerly loaded from disk before the storage layer deletes an old conversation directory during a move or rename operation. Previously, because events are loaded lazily, if a conversation was modified (e.g., toggling `--local` or changing the title) without being active, its event stream remained uninitialized in memory. The persistence logic would then delete the old directory and skip writing `events.json` to the new location because the in-memory buffer was empty, resulting in total loss of the conversation's history. The `Storage` layer now checks if a modified or active conversation has missing events in memory and attempts to load them from the old path before proceeding with the directory cleanup and write cycle. Signed-off-by: Jean Mertz <[email protected]>
1 parent 996f44f commit f341310

File tree

4 files changed

+1143
-2
lines changed

4 files changed

+1143
-2
lines changed

0 commit comments

Comments
 (0)