mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
fix(migration): 7 critical fixes for Authority migration safety and data integrity
- Fix #2: _executeStatements fallback now batches transactions (150/batch) and reorders upsert-before-delete to prevent data loss on payload overflow - Fix #3: Read/write migratedToAuthority marker in chat_metadata to prevent re-overwriting from legacy sources after Authority migration - Fix #1: Add OPFS → Authority migration channel (exportOpfsSnapshotForChat, maybeImportLegacyOpfsSnapshotToLocalStore) inserted before IndexedDB in migration chain - Fix #4: Mark runtimeVectorIndexState dirty with triviumRebuildRequired and trigger submitAuthorityVectorRebuildJob after all three migration paths - Fix #5: Dual-save safety snapshots to Authority blob; rollback can now recover from blob when local IndexedDB snapshot is unavailable - Fix #6: Add isEmptyCheck detail and console.warn for near-empty stores to help diagnose residual vs real data in store-not-empty skips - Fix #7: Add overflow warning logs and sessionStorage persistence for Authority offline queue max-items/max-bytes exceeded events
This commit is contained in:
@@ -1320,6 +1320,12 @@ class LegacyOpfsGraphStore {
|
||||
edges: emptyStatus.edges,
|
||||
tombstones: emptyStatus.tombstones,
|
||||
},
|
||||
isEmptyCheck: {
|
||||
empty: false,
|
||||
nodes: emptyStatus.nodes,
|
||||
edges: emptyStatus.edges,
|
||||
tombstones: emptyStatus.tombstones,
|
||||
},
|
||||
migrationCompletedAt: 0,
|
||||
migrationSource,
|
||||
legacyRetentionUntil,
|
||||
@@ -2707,6 +2713,12 @@ export class OpfsGraphStore {
|
||||
edges: emptyStatus.edges,
|
||||
tombstones: emptyStatus.tombstones,
|
||||
},
|
||||
isEmptyCheck: {
|
||||
empty: false,
|
||||
nodes: emptyStatus.nodes,
|
||||
edges: emptyStatus.edges,
|
||||
tombstones: emptyStatus.tombstones,
|
||||
},
|
||||
migrationCompletedAt: 0,
|
||||
migrationSource,
|
||||
legacyRetentionUntil,
|
||||
|
||||
Reference in New Issue
Block a user