Skip to content

fix(dashboard): correct double count in OSS Contributions and Issue Discoveries pools#1181

Open
blinkeye-lcm wants to merge 1 commit into
entrius:testfrom
blinkeye-lcm:fix/dashboard-pr-overview-double-count
Open

fix(dashboard): correct double count in OSS Contributions and Issue Discoveries pools#1181
blinkeye-lcm wants to merge 1 commit into
entrius:testfrom
blinkeye-lcm:fix/dashboard-pr-overview-double-count

Conversation

@blinkeye-lcm
Copy link
Copy Markdown
Contributor

Summary

The OSS Contributions and Issue Discoveries overview cards on the dashboard were double counting PRs. getPrOverviewMetrics in src/pages/dashboard/dashboardData.ts ran three independent if branches against the created, merged, and closed timestamps, incrementing separate counters in each branch. A PR created and merged in the same window therefore contributed +1 to Open, +1 to Merged, and +2 to Total. The Open tile also incremented for every PR created in the window regardless of its terminal state, so merged or closed PRs inflated the Open count too.

The fix classifies each PR once via getPrStatusLabel, pairs it with the timestamp that produced its terminal state (mergedAt for Merged, closedAt ?? prCreatedAt for Closed, prCreatedAt for Open), and increments exactly one bucket. Total becomes the sum of the three buckets by construction, so the donut segments partition the window relevant PRs cleanly and Total === Merged + Open + Closed is structurally enforced.

The closedAt ?? prCreatedAt fallback (carried over from the previous logic) is preserved so closed PRs are still tracked while the API does not return closedAt. The return shape is unchanged, so the chart center label (Merged / (Merged + Closed)) and the delta arrows on both pools continue to work without modification.

Related Issues

Fixes #1180

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Screenshots

Not applicable. No rendering code changed, only the counts feeding the existing tiles and donut chart.

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked
  • Tested against the test API
  • npm run format and npm run lint:fix have been run
  • npm run build passes
  • Screenshots included for any UI/visual changes (N/A, data layer only)

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 14, 2026
@blinkeye-lcm
Copy link
Copy Markdown
Contributor Author

Before:
before1

After:
after1

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard PR Overview pool double-counts PRs and inflates the "Open" tile

1 participant