mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 14:20:35 +08:00
Clear restored backup dirty history markers
This commit is contained in:
@@ -1120,6 +1120,10 @@ function markManualBackupHistoryForLocalRebind(snapshot = {}, chatId = "") {
|
||||
historyState.processedMessageHashesNeedRefresh =
|
||||
Number.isFinite(lastProcessedAssistantFloor) &&
|
||||
lastProcessedAssistantFloor >= 0;
|
||||
historyState.historyDirtyFrom = null;
|
||||
historyState.lastMutationReason = "";
|
||||
historyState.lastMutationSource = "";
|
||||
historyState.lastRecoveryResult = null;
|
||||
meta[RUNTIME_HISTORY_META_KEY] = historyState;
|
||||
|
||||
return {
|
||||
|
||||
@@ -632,6 +632,13 @@ async function testManualBackupAndRestoreFlow() {
|
||||
4: "hash-4",
|
||||
},
|
||||
processedMessageHashesNeedRefresh: false,
|
||||
historyDirtyFrom: 2,
|
||||
lastMutationReason: "hash-recheck",
|
||||
lastMutationSource: "event:message-received",
|
||||
lastRecoveryResult: {
|
||||
status: "pending",
|
||||
fromFloor: 2,
|
||||
},
|
||||
},
|
||||
runtimeBatchJournal: [
|
||||
{ id: "journal-1", processedRange: [0, 0], createdAt: 11 },
|
||||
@@ -757,6 +764,10 @@ async function testManualBackupAndRestoreFlow() {
|
||||
db.snapshot.meta.runtimeHistoryState.lastProcessedAssistantFloor,
|
||||
4,
|
||||
);
|
||||
assert.equal(db.snapshot.meta.runtimeHistoryState.historyDirtyFrom, null);
|
||||
assert.equal(db.snapshot.meta.runtimeHistoryState.lastMutationReason, "");
|
||||
assert.equal(db.snapshot.meta.runtimeHistoryState.lastMutationSource, "");
|
||||
assert.equal(db.snapshot.meta.runtimeHistoryState.lastRecoveryResult, null);
|
||||
assert.ok(Number(db.meta.get("lastBackupRestoredAt")) > 0);
|
||||
const safetyStatus = await getRestoreSafetySnapshotStatus(
|
||||
"chat-backup-flow",
|
||||
|
||||
Reference in New Issue
Block a user