Update round-instance date on re-apply when it changed#210
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetOrCreateRoundInstanceAsynclooked up an existingRoundInstanceby(RoundId, SeasonId)and reused it as-is, never comparing or updating itsDate. So re-applying a draft whose_metadate 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
Updateand that the stored date actually moves.🤖 Generated with Claude Code