You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(api): PATCH /v1/profiles/general has no request validation #587
PATCH /v1/profiles/general parses the request body as an untyped record and writes whatever keys it finds straight to core.users and core.profile. It is the only write path for a user's name, phone, address and bio, and it has no server-side validation at all.
No length caps, no type checks, no shape check on address, no cap on about. The client-side zod schema (general-schema.ts — 50-char names, 1500-char about) is the only enforcement, and any non-browser caller bypasses it. Every other route in this file uses createRoute + zod; this handler and GET /general are the two that do not.
Related: the same handler is what makes #580 destructive — "" passes !== undefined.
Acceptance
PATCH /v1/profiles/general is converted to app.openapi(createRoute(...)) with a request schema mirroring generalProfileSchema (names ≤50, about ≤1500, structured address, E.164-ish phone).
Invalid bodies return 400 with field-level errors, not 200.
Contract test covers over-long name, malformed address, and unknown keys.
Fixed in #597 — PATCH /v1/profiles/general now validates against a zod schema (extracted to functions/api/lib/general-info-schema.ts so it is testable without the edge runtime) and returns 400 with field-level detail. .strict() so an unexpected role or id key is a 400 rather than a silent no-op. 17 Deno assertions cover it.
Activity
thinkclay commentedon Aug 12, 2026
Part of the profile-building audit rollup: #594
fix(profile): stop General Information saving blanks over real data (#…
thinkclay commentedon Aug 12, 2026
Fixed in #597 —
PATCH /v1/profiles/generalnow validates against a zod schema (extracted tofunctions/api/lib/general-info-schema.tsso it is testable without the edge runtime) and returns 400 with field-level detail..strict()so an unexpectedroleoridkey is a 400 rather than a silent no-op. 17 Deno assertions cover it.