mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 07:07:31 +00:00
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:
@@ -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: [],
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user