Skip to content

Activity feed: stable ordering for same-timestamp results#132

Open
byte-the-bot wants to merge 1 commit into
mainfrom
activity-feed-stable-order
Open

Activity feed: stable ordering for same-timestamp results#132
byte-the-bot wants to merge 1 commit into
mainfrom
activity-feed-stable-order

Conversation

@byte-the-bot

Copy link
Copy Markdown
Collaborator

The leaderboard sidebar's recent-games feed ordered by created_at alone. All 2–4 results from one game (and results from games rated in the same batch) share a timestamp, so Postgres returned ties in arbitrary order and entries jumped around when polling the page.

Adds leaderboard_game_id DESC, placement ASC as tiebreakers: deterministic order, one game's results stay grouped, winner first.

🤖 Generated with Claude Code

Results from one rating batch share a created_at, so ORDER BY created_at
alone let ties come back in arbitrary order and the sidebar reshuffled
on every page load. Tiebreak by game then placement.
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