Skip to content

Leaderboard lists elements in random order #2

@vector1505

Description

@vector1505

🐛 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

  1. Complete several Sudoku games with different completion times.
  2. Submit each score to the leaderboard.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions