mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 01:12:16 +00:00
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:
@@ -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', () => {
|
||||
|
||||
@@ -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>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user