Skip to content

Feature/leaderboard pagination 2#372

Open
Truphile wants to merge 8 commits into
Bitcoindefi:mainfrom
Truphile:feature/leaderboard-pagination-2
Open

Feature/leaderboard pagination 2#372
Truphile wants to merge 8 commits into
Bitcoindefi:mainfrom
Truphile:feature/leaderboard-pagination-2

Conversation

@Truphile

Copy link
Copy Markdown
  1. Checked out a new branch: feature/leaderboard-pagination-2 (the branch
    name feature/leaderboard-pagination was already in use).
  2. Modified app/api/agents/leaderboard/route.ts to fetch all agents from
    agent-health-store .
  3. Integrated data retrieval from gamification/xp for the XP fields, and
    reputation/reputation-store for reputation and task count.
  4. Implemented dynamic sorting based on the sort query parameter,
    ensuring fallback sorting by agentId to resolve ties.
  5. Calculated global rank relative to the full sorted list so ranking
    stays accurate across paginated chunks.
  6. Applied limit and offset for pagination along with parameter
    validation (including returning a 400 Bad Request if the limit exceeds

closes #271

@sonarqubecloud

Copy link
Copy Markdown

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.

Agent leaderboard: paginated endpoint returning top N agents by XP, reputation, and task count

1 participant