fix(storage): make the reclaim state on the admin storage state nullable

The shared contract made reclaim a required field, so every client fixture
typed StorageAdminState stopped compiling. It is nullable now, as planned,
and the five base fixtures carry reclaim: null.
This commit is contained in:
Maurice
2026-11-01 14:20:11 +01:00
parent f44dd92ee0
commit 8fde643347
6 changed files with 10 additions and 2 deletions
@@ -35,6 +35,7 @@ function baseState(overrides: Partial<StorageAdminState> = {}): StorageAdminStat
},
health: { replicaFailures: [] },
seedFilePresent: false,
reclaim: null,
usage: null,
backfills: [],
migrations: [],
@@ -53,6 +53,7 @@ const STATE: StorageAdminState = {
},
health: { replicaFailures: [] },
seedFilePresent: false,
reclaim: null,
usage: null,
backfills: [],
migrations: [],
@@ -14,6 +14,7 @@ function baseState(overrides: Partial<StorageAdminState> = {}): StorageAdminStat
categories: { files: { backend: 'uploads-local', source: 'default' } } as StorageAdminState['categories'],
health: { replicaFailures: [] },
seedFilePresent: false,
reclaim: null,
usage: null,
backfills: [],
migrations: [],
@@ -28,6 +28,7 @@ function baseState(): StorageAdminState {
) as StorageAdminState['categories'],
health: { replicaFailures: [] },
seedFilePresent: false,
reclaim: null,
usage: null,
backfills: [],
migrations: [],
@@ -29,6 +29,7 @@ function baseState(overrides: Partial<StorageAdminState> = {}): StorageAdminStat
},
health: { replicaFailures: [] },
seedFilePresent: false,
reclaim: null,
usage: null,
backfills: [],
migrations: [],
+5 -2
View File
@@ -357,8 +357,11 @@ export const storageAdminStateSchema = z.object({
health: z.object({ replicaFailures: z.array(storageReplicaFailureSchema) }),
seedFilePresent: z.boolean(),
usage: storageUsageSchema.nullable(),
/** The reclaim switch and the last pass's report (null before the first pass). */
reclaim: storageReclaimStateSchema,
/**
* The reclaim switch and the last pass's report (`lastRun` null before the
* first pass). Nullable so a client reading an older server copes with it.
*/
reclaim: storageReclaimStateSchema.nullable(),
backfills: z.array(storageBackfillStatusSchema),
migrations: z.array(storageMigrationStatusSchema),
/** Optimistic-concurrency counter for the two settings rows (audit #7) — echo it back on the next PUT. */