Repository navigation
fix(backend): competitions join deadline, seasons rollover scoring, achievements monotonicity, and analytics bucket alignment - #2072
Merged
Olowodarey merged 1 commit intoOct 20, 2026
Conversation
…chievements monotonicity, and analytics bucket alignment - competitions: enforce join deadline rejection with clear error message, supporting inclusive boundary joins (Arena1X#1949) - seasons: deterministic prediction season attribution and rollover boundary scoring using half-open interval (Arena1X#1950) - achievements: enforce monotonic progress tracking and single-fire award semantics against replayed/out-of-order events (Arena1X#1951) - analytics: enforce half-open time-bucket event aggregation with exact single-bucket assignment, continuous zeroes, and total conservation (Arena1X#1952) Closes Arena1X#1949, Arena1X#1950, Arena1X#1951, Arena1X#1952
|
@GF-Hunter Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being deployed
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.
Summary
This pull request addresses and fixes four backend issues assigned to @GF-Hunter:
Detailed Implementation
1. Competitions Join Deadline Rejection (#1949)
backend/src/competitions/competitions.service.ts,backend/src/competitions/entities/competition.entity.ts,backend/src/competitions/dto/create-competition.dto.tsjoin_deadlineto competition entity and create competition DTO.joinCompetition: requests strictly after the deadline (now > deadline) are rejected withBadRequestExceptioncontaining the ISO deadline.now <= deadline) are allowed.a join after deadline is rejected with a clear error containing the deadlinea join before deadline succeedsa join exactly at the boundary follows the documented rule (inclusive boundary succeeds)2. Seasons Rollover Boundary Scoring (#1950)
backend/src/seasons/seasons.service.tsattributePredictionToSeason/attributePredictionandscorePredictionForSeasonto deterministically attribute predictions to seasons by the documented half-open interval rule[starts_at, ends_at).t === season.ends_at === next_season.starts_at) follow the documented policy (exclusive of prior season end, inclusive of next season start).a prediction made before rollover scores in the prior seasona prediction resolved after rollover is attributed per the ruleboundary-exact timestamps follow the documented inclusive/exclusive policy3. Achievements Progress Monotonicity (#1951)
backend/src/achievements/achievements.service.tsrecordProgressandupdateProgresswith monotonic progress guarantees:newProgress = Math.max(existing.current_value, value).replayed events do not double-award an achievementout-of-order events never decrease progresscrossing a threshold awards exactly once4. Analytics Event Aggregation Bucket Alignment (#1952)
backend/src/analytics/analytics.service.tsaggregateEventsByTimeBucketimplementing the documented half-open interval[bucket_start, bucket_end).timestamp === bucket_startand never double-count.count: 0,total_value: 0), ensuring continuity.an edge-timestamp event lands in exactly one bucketsum of buckets equals the ungrouped totalempty buckets are represented as zero, not omitted where continuity is required