fix: mark backup snapshots without metadata invalid

This commit is contained in:
AI Bot
2026-06-06 19:26:18 +08:00
parent cfd41b4fbf
commit bddbe8b5ba
2 changed files with 10 additions and 1 deletions

View File

@@ -234,6 +234,15 @@ test("backup actions reject snapshots with missing or mismatched metadata", asyn
assert.equal(missingMetaPayload.verification.ok, false);
assert.equal(missingMetaPayload.verification.message, "snapshot metadata is missing");
const listAfterMissingMeta = await getBackups(await requestFor("owner@boss.com", "highest_admin"));
assert.equal(listAfterMissingMeta.status, 200);
const listAfterMissingMetaPayload = await listAfterMissingMeta.json();
const missingMetaListedSnapshot = listAfterMissingMetaPayload.snapshots.find(
(snapshot: { snapshotId: string }) => snapshot.snapshotId === snapshotId,
);
assert.equal(missingMetaListedSnapshot.verification.ok, false);
assert.equal(missingMetaListedSnapshot.status, "error");
const missingMetaPreview = await postBackups(
await requestFor("owner@boss.com", "highest_admin", {
method: "POST",