fix: reconcile JourneyItem note maxlength — frontend caps at 2000, backend accepts 5000 #793
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
JourneyItemRow.svelteenforcesmaxlength="2000"on the note textarea, matching the spec. But the backend constantJourneyItemService.MAX_NOTE_LENGTHis set to 5000 characters — no@Sizeor@Validconstraint enforces this at the HTTP boundary.This creates an inconsistent contract:
JourneyEditorUI are capped at 2000 chars.PATCH /api/geschichten/{id}/items/{itemId}API call can be up to 5000 chars.JourneyItemRowtextarea'sbind:valuewill load all 4000 chars — but themaxlength="2000"attribute silently prevents the user from editing beyond that point, and a blur-triggeredonNotePatchcall would truncate the content.Decision needed
One of these must be chosen before this stays in production:
maxlengthto5000inJourneyItemRow.svelteand the spec. The backend is the source of truth.@Size(max = 2000)validation to the PATCH DTO and updateMAX_NOTE_LENGTHto 2000. The spec is the source of truth.Acceptance criteria
maxlengthinJourneyItemRow.sveltematches the backend constraintJOURNEY_NOTE_TOO_LONGerror (400) when the limit is exceeded via API — regardless of the chosen limitContext
Surfaced during PR review of #792 (JourneyEditor frontend). The PR description acknowledges the discrepancy; this issue tracks the resolution.