saveProfile doesn't check the event date server-side #155
Labels
No labels
accessibility
area:accounts
area:ai-evals
area:look
area:maps
area:platform
area:rides-progress
area:riding
area:today-plan-coach
area:ui-shell
bot:blocked
bot:failed
bot:pr
bot:waiting
bot:working
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
later
now
owner-check
parked
question
ready
session
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ckreidl/trainer#155
Loading…
Reference in a new issue
No description provided.
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?
saveProfiledoes not check server-side that an event date is in the future (only the form does). Add it withtodayInif it matters.Moved from docs/PROGRESS.md → Follow-ups → Later on 2026-11-08.
What this is about. The profile form won't accept an event date in the past, but the server function
saveProfile(src/server/athlete.ts) doesn't check it again. Anyone calling the server directly could save a past event date.Status (checked 2026-11-08): unchanged.
Fix: one check with
todayIn(timeZone)in the validator, plus a test. Five minutes; worth doing the next timeathlete.tsis touched (session 52, #227, changes the profile).Status (checked 2026-11-18): still open. Session 52 touched the profile without it. Only the form checks for a future date (
src/domain/athlete-form.ts:57). The server'sProfileInput(src/domain/schemas/profile.ts,goalRule) checks only that an event has a date. A shared refinement takingtodaywould cover both.