feat(storage): confirm the reclaim count the admin was shown, name a running backup as a skip, bound a trip cover

The confirm request now carries the unreferenced count the admin saw, so the
server can refuse a count its last report no longer holds. A pass that found
objects due while a backup read the uploads reports backup_running for them.
A trip cover is bounded to 2048 characters on REST, RPC and the MCP tool, as a
place image already is, since a replaced cover is queued for release by every
upload path it spells out.
This commit is contained in:
Maurice
2026-11-01 18:11:25 +01:00
parent 59a6d92cea
commit 0a25de2c6d
5 changed files with 40 additions and 8 deletions
+7
View File
@@ -48,6 +48,13 @@ describe('tripUpdateRequestSchema', () => {
expect(tripUpdateRequestSchema.safeParse({}).success).toBe(true);
expect(tripUpdateRequestSchema.safeParse({ is_archived: 1, cover_image: null }).success).toBe(true);
});
it('bounds cover_image like a place image url: a replaced cover is queued for release', () => {
expect(tripUpdateRequestSchema.safeParse({ cover_image: `/uploads/covers/${'a'.repeat(2000)}` }).success).toBe(
true,
);
expect(tripUpdateRequestSchema.safeParse({ cover_image: 'x'.repeat(2049) }).success).toBe(false);
});
});
describe('tripAddMemberRequestSchema', () => {
+3 -1
View File
@@ -118,7 +118,9 @@ export const tripUpdateRequestSchema = z.object({
reminder_days: z.number().optional(),
day_count: z.number().optional(),
is_archived: z.union([z.boolean(), z.number()]).optional(),
cover_image: z.string().nullable().optional(),
// Bounded like a place's image url: a replaced cover is queued for release,
// and every upload path the old value spells out is one queued object.
cover_image: z.string().max(2048).nullable().optional(),
});
export type TripUpdateRequest = z.infer<typeof tripUpdateRequestSchema>;