Summary
Event slug generation uses Math.random().toString(36).slice(2, 6) — a 4-character base36 suffix. Birthday-paradox math gives a collision rate around 1-in-1.6M per name, surfacing as a generic 500 from the unique-constraint insert. Low but non-zero.
Requirements
Context
Flagged in the Plan 2 review. Forms (Plan 4) will also need slug generation — fix once and reuse.
Summary
Event slug generation uses
Math.random().toString(36).slice(2, 6)— a 4-character base36 suffix. Birthday-paradox math gives a collision rate around 1-in-1.6M per name, surfacing as a generic 500 from the unique-constraint insert. Low but non-zero.Requirements
try/retryloop that regenerates on unique-constraint conflictpackages/api/src/routes/admin/events/index.ts,packages/api/src/routes/eventsSubmit.tsslug.tshelper lands first (refactor(api): extract shared artifact-admin helpers (list query, scope defaults, slugify) #2002), apply the fix once thereContext
Flagged in the Plan 2 review. Forms (Plan 4) will also need slug generation — fix once and reuse.