Skip to content

Improve leaderboard pagination to preserve loaded users during real-time updates (Issue #227)#271

Open
anshul23102 wants to merge 1 commit into
indresh404:mainfrom
anshul23102:fix/227-leaderboard-pagination-performance
Open

Improve leaderboard pagination to preserve loaded users during real-time updates (Issue #227)#271
anshul23102 wants to merge 1 commit into
indresh404:mainfrom
anshul23102:fix/227-leaderboard-pagination-performance

Conversation

@anshul23102
Copy link
Copy Markdown
Contributor

Summary

Prevent real-time listener from resetting paginated data. When initial leaderboard updates fire, update only the first batch of users while preserving any data loaded via pagination. This ensures that users retain their pagination state while still seeing real-time rank updates for the top 50.

Changes

  • Modify real-time listener to merge initial batch with existing paginated data
  • Preserve all users loaded beyond the first 50 when updating from real-time listener
  • Prevent list resets during routine real-time updates

Testing

  1. Navigate to the GitRank leaderboard page
  2. View the initial 50 users
  3. Click "Load More" to fetch the next 50 users (total 100 displayed)
  4. Wait for a few moments to allow real-time listener to fire
  5. Verify that users still see all 100 users instead of list resetting to 50
  6. Verify that ranks in the initial 50 update in real-time if there are changes
  7. Test with different language filters to ensure pagination is preserved correctly

Type of Change

  • Performance optimization
  • Bug fix

Contributor Declaration

This contribution is original work and I have the right to contribute this code to the project. I understand that the project is licensed under its respective license and my contributions will be available under the same license terms.

Closes #227

…ime updates (Issue indresh404#227)

Prevent real-time listener from resetting paginated data. When initial leaderboard updates fire, update only the first batch of users while preserving any data loaded via pagination. This ensures that users retain their pagination state while still seeing real-time rank updates for the top 50.

Changes:
- Modify real-time listener to merge initial batch with existing paginated data
- Preserve all users loaded beyond the first 50 when updating from real-time listener
- Prevent O(N) list resets during routine real-time updates

Fixes indresh404#227
@anshul23102 anshul23102 requested a review from indresh404 as a code owner June 3, 2026 19:49
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ranker-hub Ready Ready Preview, Comment Jun 3, 2026 7:50pm

@github-actions github-actions Bot added bug Something isn't working enhancement New feature or request frontend Frontend related changes (HTML/CSS/JS/React) gssoc GirlScript Summer of Code gssoc26 GirlScript Summer of Code 2026 nsoc NSoC NSoC'26 NSoC 2026 pending-review PR is pending review labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request frontend Frontend related changes (HTML/CSS/JS/React) gssoc GirlScript Summer of Code gssoc26 GirlScript Summer of Code 2026 nsoc NSoC NSoC'26 NSoC 2026 pending-review PR is pending review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Performance] Leaderboard Pagination Re-ranks All Previously Loaded Users on Each Load

1 participant