Summary
Start Session's Custom Identifier path shows two contradictory errors under the same field: the real format error, plus a spurious "This field is required" on a field the user demonstrably filled.
Where
apps/web/src/components/StartSessionForm/StartSessionForm.tsx
The Custom Identifier superRefine adds a "This field is required" issue when !val.subjectId. When the identifier's own .refine() (the format check) fails, Zod hands superRefine an undefined subjectId even though the user typed a non-empty value — so a genuinely-filled field also gets the required-field error.
Repro
- Start Session → Custom Identifier
- Type
abc$def as the Identifier
- Fill a valid Date of Birth and Sex
- Submit
Result: two errors under Identifier — "Illegal character: $" and "This field is required".
Suggested fix
Guard the superRefine check so it only fires when the field is genuinely absent from the raw input, rather than inferring absence from a value Zod has already rejected.
Notes
Found while writing the Playwright suite (branch e2e-tests).
Summary
Start Session's Custom Identifier path shows two contradictory errors under the same field: the real format error, plus a spurious "This field is required" on a field the user demonstrably filled.
Where
apps/web/src/components/StartSessionForm/StartSessionForm.tsxThe Custom Identifier
superRefineadds a "This field is required" issue when!val.subjectId. When the identifier's own.refine()(the format check) fails, Zod handssuperRefineanundefinedsubjectIdeven though the user typed a non-empty value — so a genuinely-filled field also gets the required-field error.Repro
abc$defas the IdentifierResult: two errors under Identifier — "Illegal character: $" and "This field is required".
Suggested fix
Guard the
superRefinecheck so it only fires when the field is genuinely absent from the raw input, rather than inferring absence from a value Zod has already rejected.Notes
Found while writing the Playwright suite (branch
e2e-tests).