Repository navigation
Description
Summary
The website's contact and request-demo forms promise "Keep your message to 2,000 characters or fewer." (forms.validation.messageTooLong), and their shared schema accepts up to 2,000 characters. The submit endpoint, however, refuses any request body over 4,096 bytes. Non-Latin scripts need 2–3 bytes per character in UTF-8, so messages inside the promised limit are refused:
| Message script | Request body for a 2,000-character message | Longest message accepted |
|---|---|---|
| English | 2,175 bytes, accepted | 2,000 characters |
| Russian, Greek, Arabic | 4,175 bytes, refused with 413 | 1,960 characters |
| Japanese, Chinese | 6,175 bytes, refused with 413 | 1,307 characters |
How the figures were computed: the contact form, with a typical name, email and company, using the exact JSON body that lib/forms/submit-client.ts:13–16 sends. The request-demo body carries a few more fields, so it is slightly larger. Real German text stays well under the cap: a 2,000-character sample is 2,841 bytes.
What the visitor sees: only forms.errors.generic, "Something went wrong. Try again." In de: "Etwas ist schiefgelaufen. Versuch es erneut." In fr: "Quelque chose s’est mal passé. Réessaie."
lib/forms/submit-errors.ts:18–23maps every status other than 429 and 5xx to the generic message.- Retrying sends the same body and fails again.
- No field error appears, and nothing tells the visitor to shorten the message. The contact or demo request is lost unless they guess.
Reproduction
Derived from source; not run live, because the local stack is blocked by the missing heavy-phase reservation.
- Open
/contactor/request-demoand fill in the required fields. - Write a 1,400-character message in Japanese, or a 1,980-character message in Russian.
- Tick the privacy box, wait 3 seconds and submit.
- The request is refused: it answers 413
{"ok":false,"error":"Payload too large"}. The form shows "Something went wrong. Try again." Every retry gives the same result.
Source
At main e836391d5:
- The byte cap:
services/web/server.ts:46setsMAX_BODY_BYTES = 4 * 1024.:111–115refuses aContent-Lengthabove it with 413.:119–123repeats the check on the UTF-16 length.
- The character limits:
services/web/lib/forms/schemas.tsallows 2,000 characters each for name (:17), company (:21), email (:32) and message (:24–25for request-demo,:93–98for contact). - The fallback to the generic message:
lib/forms/submit-errors.ts:18–23, shown byapp/components/blocks/form-card.tsx:252–266. - A related edge with the same mapping: the server re-checks the 3-second minimum against its own clock, but uses the browser's
startedAt(server.ts:147–151). A visitor whose clock runs ahead of the server gets 400Submitted too quickly, which is also shown as the generic message.
Expected
- Either the server accepts every body the schema allows, or the client enforces the same byte budget:
- Server: the worst case is about 4 × 2,000 characters × 3 bytes plus JSON overhead, roughly 24 KiB.
- Client: enforce the byte budget and show
validation.messageTooLongwith the real limit.
- A 413 maps to a message that names the cause (the message is too long) instead of "Try again".
- Regression tests:
- a server test showing a schema-maximum message in a 3-byte script is accepted, or a schema test for the byte budget;
- a
submit-errorstest for 413.
Triage
- Severity: low. It's an edge case, but the visitor's request is lost without explanation, for anyone writing at length in a non-Latin script.
- Owner: the website maintainers.
- Review A cells:
web.contactandweb.request-demo, UX-CLARITY and REL-MANUAL. Found from static evidence by Review A (TALE-358) at the 2026-10-10 00:15 Europe/Zurich occurrence. Not observed live.
Activity
fix(web): accept 2,000-character form messages in any script