Skip to content

API: PUT /me/solving-times/{id} keeps the time's competition link - #205

Merged
JanMikes merged 1 commit into
mainfrom
fix/api-put-keeps-competition-link
Aug 19, 2026
Merged

API: PUT /me/solving-times/{id} keeps the time's competition link#205
JanMikes merged 1 commit into
mainfrom
fix/api-put-keeps-competition-link

Conversation

@JanMikes

Copy link
Copy Markdown
Member

What

PUT /api/v1/me/solving-times/{timeId} dispatched EditPuzzleSolvingTime with competitionId: null; EditPuzzleSolvingTimeHandlerPuzzleSolvingTime::modify() assigns the competition unconditionally, so every API edit silently detached the time from its event. The processor now carries the time's current competition through (it already loads the entity for the ownership check). The round link is never touched by modify(), so it was — and stays — intact.

Why a separate tiny PR

Live data-loss bug, 1-line fix; it ships ahead of the larger picker work tracked in #204 (PR 1 of 4).

Tests

  • New UpdateSolvingTimeEndpointTest::testUpdateKeepsCompetitionAndRoundLink (PUT on a WJPC-linked fixture time keeps competition_id + competition_round_id) — verified it fails on main (null vs the WJPC id) and passes here.
  • Full gates green locally: cs, phpstan (max), "Project Test Suite" (2184 tests), schema:validate, prod warmup.

Docs

docs/features/api/README.md: PUT never changes the event link.

Refs #204

🤖 Generated with Claude Code

https://claude.ai/code/session_01QUegPi2i9SjwkcrNWyENnL

The PUT payload has no event field, but the processor dispatched
EditPuzzleSolvingTime with competitionId: null and modify() assigns it
unconditionally, so every API edit silently detached the time from its
competition. Carry the current link through; the round link was never
touched by modify() and stays intact.

Refs #204

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUegPi2i9SjwkcrNWyENnL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant