Skip to content

[Bug] Fake hardcoded stats shown on landing page when GitHub API fails #1245

@akhilmodi29

Description

@akhilmodi29

Bug Description

When the GitHub API fails or is rate-limited, the landing page displays
hardcoded fake stats (40 stars, 160 forks, 307 open issues, 30 contributors)
instead of real data. These invented numbers appear as genuine social proof
to every visitor.

Steps to Reproduce

  1. Block api.github.com in your network or let it rate-limit
  2. Visit the landing page /
  3. Observe: stats show 40 stars, 160 forks, 307 issues — all fake

Expected Behavior

When the GitHub API is unavailable, stats should show 0 or nothing
rather than invented numbers.

Root Cause

The catch block in fetchRepoStats() inside src/app/page.tsx
returns hardcoded non-zero values instead of zeros.

Fix

Return all zeros in the fallback:

} catch {
  return {
    stars: 0,
    forks: 0,
    openIssues: 0,
    contributorCount: 0,
    goodFirstIssues: 0,
    contributors: [],
  };
}

File Affected

src/app/page.tsxfetchRepoStats() function

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageNeeds maintainer triage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions