From 53aa88a65918f9f252a5094684d38a9f107c8d16 Mon Sep 17 00:00:00 2001 From: beyondkmp Date: Fri, 1 Aug 2025 10:00:52 +0800 Subject: [PATCH] feat(database): enable strict transaction durability for CherryStudio database (#8737) - Updated the Dexie database initialization to include `chromeTransactionDurability: 'strict'`, enhancing data integrity during transactions. --- src/renderer/src/databases/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/databases/index.ts b/src/renderer/src/databases/index.ts index baadb0d0d0..a255ed0630 100644 --- a/src/renderer/src/databases/index.ts +++ b/src/renderer/src/databases/index.ts @@ -6,7 +6,9 @@ import { Dexie, type EntityTable } from 'dexie' import { upgradeToV5, upgradeToV7, upgradeToV8 } from './upgrades' // Database declaration (move this to its own module also) -export const db = new Dexie('CherryStudio') as Dexie & { +export const db = new Dexie('CherryStudio', { + chromeTransactionDurability: 'strict' +}) as Dexie & { files: EntityTable topics: EntityTable<{ id: string; messages: NewMessage[] }, 'id'> // Correct type for topics settings: EntityTable<{ id: string; value: any }, 'id'>