From bd795365c196823304574b2a2f8a47d9630a0012 Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 30 Nov 2026 14:40:27 +0100 Subject: [PATCH] fix(journey): let the from-photos create take every group a preview hands out A long journey of single-photo days yields more than 200 groups, and a day without positions can hold more than 1000 photos in one group; the client sends all kept groups in one call, which the contract refused. --- .../journey/journey-entries-from-photos.schema.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/shared/src/journey/journey-entries-from-photos.schema.ts b/shared/src/journey/journey-entries-from-photos.schema.ts index 26a7d1808..c02e1938a 100644 --- a/shared/src/journey/journey-entries-from-photos.schema.ts +++ b/shared/src/journey/journey-entries-from-photos.schema.ts @@ -25,10 +25,14 @@ import { z } from 'zod'; export const JOURNEY_FROM_PHOTOS_DEFAULT_GAP_MINUTES = 180; /** Two geotagged photos further apart than this start a new group, unless the request says otherwise. */ export const JOURNEY_FROM_PHOTOS_DEFAULT_DISTANCE_KM = 20; -/** The most groups one create call takes. */ -export const JOURNEY_FROM_PHOTOS_MAX_GROUPS = 200; -/** The most photos one group of a create call takes. */ -export const JOURNEY_FROM_PHOTOS_MAX_PHOTOS_PER_GROUP = 1000; +/** + * The most groups one create call takes. The client sends every group of a + * preview it keeps in one call, and a long journey of single-photo days has + * hundreds, so this sits well above what a preview hands out. + */ +export const JOURNEY_FROM_PHOTOS_MAX_GROUPS = 1000; +/** The most photos one group of a create call takes: a whole day of a wedding or a safari without a position fits. */ +export const JOURNEY_FROM_PHOTOS_MAX_PHOTOS_PER_GROUP = 10_000; /** Whether the runtime knows this IANA zone name ('Europe/Rome', 'UTC'). */ export function isKnownTimeZone(zone: string): boolean {