Context
migrateV1() in conversationStore.ts unconditionally overwrites index.json with a single-entry array when migrating legacy chat.json data. If the .migrated marker is missing but index.json already has conversations, this could destroy existing metadata.
Flagged during PR review analysis — risk is low and theoretical, but worth tracking.
Action
Investigate removing migrateV1() entirely. The only users are the dev team — there are no external users who need this migration path. If confirmed safe, remove the migration code and the .migrated marker logic to reduce complexity.
If removal isn't viable for some reason, a simple "skip if index exists" guard is sufficient — a full merge/dedup implementation is not warranted.
References
- File:
packages/main/src/conversationStore.ts (~lines 169–230)
- Priority: Low
Context
migrateV1()inconversationStore.tsunconditionally overwritesindex.jsonwith a single-entry array when migrating legacychat.jsondata. If the.migratedmarker is missing butindex.jsonalready has conversations, this could destroy existing metadata.Flagged during PR review analysis — risk is low and theoretical, but worth tracking.
Action
Investigate removing
migrateV1()entirely. The only users are the dev team — there are no external users who need this migration path. If confirmed safe, remove the migration code and the.migratedmarker logic to reduce complexity.If removal isn't viable for some reason, a simple "skip if index exists" guard is sufficient — a full merge/dedup implementation is not warranted.
References
packages/main/src/conversationStore.ts(~lines 169–230)