fix(dashboard): replace per-miner mirror fan-out with single bulk call#1134
Merged
Conversation
Replaces N parallel mirror.gittensor.io/api/v1/miners/<id>/issues calls on every dashboard mount with a single call to /api/v1/dashboard/issues (see entrius/das-github-mirror#93). Eliminates the rate-limit cascade of 304s on /dashboard. Also fixes #1125 (Issues Resolved trend always 0): the resolved-issue predicate is now the conjunction (state=CLOSED, state_reason=COMPLETED, solving_pr.merged_at not null) and the resolved bucket uses solving_pr.merged_at instead of closed_at. Architecture: mirror is roster-blind, gittensor backend owns the miner roster, frontend blends. Watchlist and Miner Details continue to use the per-miner endpoint (low N, page-scoped).
# Conflicts: # src/pages/dashboard/dashboardData.ts # src/pages/dashboard/useDashboardData.ts
entrius
approved these changes
May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the dashboard's N parallel
mirror.gittensor.io/api/v1/miners/<id>/issuescalls (one per active miner, ~25+ on a typical mount) with a single call to the new/api/v1/dashboard/issuesendpoint. Eliminates the rate-limit pressure visible as a cascade of 304s in DevTools on/dashboard. Also fixes #1125 (Issues Resolved trend always 0) by switching the resolved-issue predicate to the correct conjunction.Depends on entrius/das-github-mirror#93 — must be merged + deployed first.
Architectural shape
das-github-mirror)api.gittensor.io)useAllMiners()for the roster, callsuseMirrorDashboardIssues()for raw GitHub trend data, filters/buckets client-side.Resolved predicate fix (#1125)
Old:
state === 'CLOSED' && state_reason === 'COMPLETED'— missed every issue that was closed by a merged PR but not flagged COMPLETED. Trend series rendered as flat 0.New:
state === 'CLOSED' && state_reason === 'COMPLETED' && !!solving_pr?.merged_at— the conjunction matches the "Solved" definition used elsewhere in the app. Bucketing also moves fromclosed_attosolving_pr.merged_atso the bar reflects when the PR landed.Changes
New files
src/api/models/MirrorDashboard.ts—MirrorDashboardIssue,MirrorDashboardIssuesResponsesrc/api/MirrorDashboardApi.ts—useMirrorDashboardIssues(since, enabled?)hook (single-call viauseMirrorApiQuery)Edits
src/api/index.tsandsrc/api/models/index.ts— barrel exportssrc/pages/dashboard/dashboardData.ts:isResolvedMinerIssuepredicate: now the conjunction (Dashboard "Issues resolved" trend series is always 0 (wrong resolved-issue predicate) #1125 fix)solving_pr.merged_atinstead ofclosed_atMirrorDashboardIssue[]instead ofMinerIssue[]flattenMinerIssues(no dedupe needed for single-call source) andgetMirrorSinceParam(no range-dependent since)GITTENSOR_START_MSsrc/pages/dashboard/useDashboardData.ts:useMinersIssuesfan-out with singleuseMirrorDashboardIssuescall,sincepinned at module load to keep the React Query cache key stable across renders/remountshasIssueActivity+activeMinerGithubIdsminerGithubIdSetmemo built fromminersQuery.datadashboardIssues.filter(i => minerGithubIdSet.has(i.author_github_id))Related Issues
Fixes #1125
Type of Change
Screenshots
Before — DevTools Network tab on
/dashboard:After:
Test plan
/dashboardmounts and the Contribution Trends chart renders all four series.mirror.gittensor.io/api/v1/dashboard/issues?since=...request fires per dashboard mount (no/miners/<id>/issuesrequests from the dashboard route).Checklist
npm run formatandnpm run lint:fixhave been runnpm run buildpassesOut of scope
bucket=hourto the mirror endpoint or compute hourly buckets client-side from the same dataset.useMinersIssuesper-miner — N is small there, no rate-limit pressure.