🐛 Bug Report: Leaderboard lists elements in random order
Description
The leaderboard currently displays player entries in a random order instead of sorting them properly. This makes it difficult to compare scores and defeats the purpose of the leaderboard.
Problem
- Entries appear in no clear order (seemingly random).
- Players cannot tell who has the fastest completion time.
- The leaderboard loses accuracy and fairness.
Expected Behavior
- The leaderboard should display results in descending order of performance (e.g., fastest time at the top).
- If times are equal, secondary sorting criteria (like submission timestamp or difficulty level) could be applied.
Steps to Reproduce
- Complete several Sudoku games with different completion times.
- Submit each score to the leaderboard.
- Observe that the entries appear in random order instead of sorted.
Possible Fix
- Check the sorting logic in
leaderboard.jsx.
- Ensure that data is being sorted before rendering (e.g., by completion time in ascending order).
- Consider adding a tie-breaking rule (e.g., earlier submission comes first).
Additional Context
- The issue might come from the database query not enforcing an
ORDER BY clause.
- Alternatively, sorting may need to be applied on the frontend after fetching data.
🐛 Bug Report: Leaderboard lists elements in random order
Description
The leaderboard currently displays player entries in a random order instead of sorting them properly. This makes it difficult to compare scores and defeats the purpose of the leaderboard.
Problem
Expected Behavior
Steps to Reproduce
Possible Fix
leaderboard.jsx.Additional Context
ORDER BYclause.