[BUG] Compare metrics reports zeroes when GitHub searches fail
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
What happened?
The compare endpoint returns HTTP 200 with default zero counts when secondary GitHub requests fail. The initial user lookup handles errors, but failed commit, repository, or PR searches leave streak, commits30d, or prs at zero (and repositories as Unknown). A GitHub 403, rate limit, or 5xx is therefore presented as valid user data. See the response handlers for commitsRes, reposRes, and prsRes in src/app/api/metrics/compare/route.ts.
Proposed solution: Check every upstream response and return a consistent error or explicit partial-result indicator; do not silently serialize default values as successful metrics. Add mocked tests for each failed subrequest and assert that the response cannot be mistaken for real zero values.
Steps to reproduce
- Request compare metrics for a valid GitHub username while the initial user lookup succeeds.
- Make a subsequent commit, repository, or PR search return 403 or 5xx.
- Observe that the route still returns HTTP 200 with zero/default values for the failed metric.
Where is it?
API
Where did you see it?
Local development
Browser and device
Not browser-specific: server-side API route. Local environment: Linux x86_64, Node v26.13.1, Vitest 4.1.12.
Screenshots, console errors or logs
No screenshot applies to this API behavior. Validation: ./node_modules/.bin/tsc --noEmit completed successfully. Focused existing tests ./node_modules/.bin/vitest run test/goals-sync-lib.test.ts test/weekly-summary-combined.test.ts --reporter=dot passed (2 files, 28 tests); they do not cover failed GitHub subrequests in this endpoint. Full ./node_modules/.bin/vitest run: 3,405 passed, 54 failed. All 54 failures were in six component suites because localStorage was undefined in JSDOM; they are unrelated to this API path. The current tests do not verify failed responses for these three requests, so the mocked regression cases above should be added.
Want to fix it?
- I'd like to work on this. A maintainer will assign you; please don't start before that.
- Lingua principale
- TypeScript
- Stelle
- 246
- Fork
- 436
- Merge medio
- 9h 33m
- PR unite (30g)
- 213
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Priyanshu-byte-coder/devtrack
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Priyanshu-byte-coder/devtrack#4067 ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Priyanshu-byte-coder/devtrack#4066 ·
I maintainer di solito rispondono entro 1 giorno
-
Webhook manager: replace the browser confirm() dialogs with ConfirmModalForse già presa @Nandaninaulaa l’ha presa 4 giorni fa. Apertagood first issue level 1 level:beginner status:assigned type:design
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
Priyanshu-byte-coder/devtrack#3889 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Goals form: square arcade buttons for recurrence, Create goal and RefreshForse già presa @KartikeyG-world l’ha presa 4 giorni fa. Apertagood first issue level 1 level:beginner status:assigned type:design
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
Priyanshu-byte-coder/devtrack#3877 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Goals: the error banner and the "No goals yet" hint show at the same timeForse già presa @KartikeyG-world l’ha presa 4 giorni fa. Apertagood first issue level 1 level:beginner status:assigned type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
Priyanshu-byte-coder/devtrack#3872 · 6 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Priyanshu-byte-coder/devtrack
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
makecindy/cindy#15342 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
kwitsch/claude-code-plugin-tooling#219 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
no-repo-link tool-submission
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100