Skip to content

Bug: Repositories with identical star counts render in non-deterministic, flickering order #613

Open

Description

@pradeep0153

Description

A logic bug exists in the primary <RepositoryGrid /> sorting algorithm. The grid is designed to sort a user's repositories by total stars (descending). However, if a user has multiple repositories with the exact same star count (e.g., three repos with 0 stars, or two repos with 5 stars), the Array.prototype.sort() algorithm fails to implement a deterministic secondary sorting parameter. This causes the order of those specific repositories to flicker and change randomly every time the page is refreshed or a new batch is paginated.

Proposed Solution

  • Audit the client-side (or server-side) sorting utility function applied to the repository array.
  • Implement a robust, multi-tier sorting heuristic.
  • The primary sort parameter must remain stargazerCount (descending).
  • Inject a strict secondary sort parameter: if repoA.stargazerCount === repoB.stargazerCount, fallback to sorting by updatedAt (most recently pushed to first).
  • This mathematically guarantees a 100% deterministic, stable rendering order across all sessions, completely eliminating the UI flicker and ensuring the user's most recently active projects are always prioritized in tie-breaker scenarios.

Activity

  1. github-actions commented on Jul 26, 2026

    @github-actions
    Contributor

    Hey @pradeep0153, thanks for opening this issue! 👋

    Before anyone starts working on this, please comment below explaining your approach — what you plan to do and how you plan to do it.

    A few things to keep in mind:

    • ✍️ Write the explanation yourself — don't paste AI-generated text. We want to understand how you think about the problem.
    • 📌 Wait to be assigned before you start coding. This avoids two people solving the same thing at once.
    • 📋 Read CONTRIBUTING.md if you haven't already.

    Once a maintainer reviews your approach and assigns the issue to you, you're good to go. Looking forward to it! 🚀

  2. mspandey commented on Jul 29, 2026

    @mspandey
    Contributor

    pls assign it to me

  3. github-actions commented on Aug 29, 2026

    @github-actions
    Contributor

    This issue has seen no activity for 30 days. It has been marked as stale and will be closed in 7 days if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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