Skip to content

Update round-instance date on re-apply when it changed#210

Merged
PatrikBak merged 1 commit into
mainfrom
patrik/fix-round-instance-date-reuse
Jun 18, 2026
Merged

Update round-instance date on re-apply when it changed#210
PatrikBak merged 1 commit into
mainfrom
patrik/fix-round-instance-date-reuse

Conversation

@PatrikBak

Copy link
Copy Markdown
Owner

GetOrCreateRoundInstanceAsync looked up an existing RoundInstance by (RoundId, SeasonId) and reused it as-is, never comparing or updating its Date. So re-applying a draft whose _meta date was corrected silently left the stale date in the DB — which bit a real case where CPSJ TST round-instance dates landed after the CPSJ match date and didn't move on re-apply.

Now a found instance whose stored date differs from the draft's is updated in place and reported via a new ResolutionAction.Update, distinct from the quiet reuse path, mirroring how the author/tag reconcilers surface a change. The mutation rides the tracked entity and flushes on the existing save. The apply report renders create and update alike as the noteworthy (yellow) path; reuse stays quiet.

Covered by a new real-DB integration test asserting both that the round-instance reports Update and that the stored date actually moves.

🤖 Generated with Claude Code

GetOrCreateRoundInstanceAsync looked up an existing RoundInstance by
(RoundId, SeasonId) and reused it as-is, never comparing or updating its
Date. So re-applying a draft whose _meta date was corrected silently left
the stale date in the DB — which bit a real case where CPSJ TST dates
landed after the CPSJ match date and didn't move on re-apply.

Now a found instance whose stored date differs from the draft's is updated
in place and reported via a new ResolutionAction.Update, distinct from the
quiet reuse path, mirroring how the author/tag reconcilers surface a change.
The apply report renders create and update alike as noteworthy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
math-comps Ready Ready Preview, Comment Jun 18, 2026 10:52am

@PatrikBak PatrikBak enabled auto-merge June 18, 2026 10:51
@PatrikBak PatrikBak merged commit b5289e4 into main Jun 18, 2026
5 checks passed
@PatrikBak PatrikBak deleted the patrik/fix-round-instance-date-reuse branch June 18, 2026 10:55
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