feat(database): enable strict transaction durability for CherryStudio database (#8737)

- Updated the Dexie database initialization to include `chromeTransactionDurability: 'strict'`, enhancing data integrity during transactions.
This commit is contained in:
beyondkmp 2025-08-01 10:00:52 +08:00 committed by GitHub
parent e76a68ee0d
commit 53aa88a659
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<FileMetadata, 'id'>
topics: EntityTable<{ id: string; messages: NewMessage[] }, 'id'> // Correct type for topics
settings: EntityTable<{ id: string; value: any }, 'id'>