The preview page keeps showing the previous report after a check fails
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 88/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
Direzione di ricerca
Leggi src/components/preview/usePreviewState.ts e segui checkUrl nei suoi rami di errore; src/components/preview/PreviewApp.tsx mostra come vengono visualizzati l’errore e il report. Verifica manualmente un URL valido seguito da un 404 e da un errore della richiesta, quindi esegui di nuovo una verifica valida. Il lavoro è completo quando le verifiche non riuscite mostrano solo l’errore, un successo successivo mostra il relativo report e il PR documenta la verifica con npm run dev e uno screenshot.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On https://og.codercops.com/preview, check gohugo.io, then check gohugo.io/no-such-page. The red "Failed to fetch URL: 404 Not Found" banner shows up, but gohugo.io's whole report stays under it: the B grade, the issues and the platform previews. It looks as if the report belongs to the URL that just failed.
checkUrl in src/components/preview/usePreviewState.ts clears the old error when a check starts (line 86). When the check fails, it sets the new error and returns (lines 92 to 95) without clearing data, and the catch (lines 102 to 103) doesn't clear it either. PreviewApp.tsx shows the error (lines 41 to 45) and the report (lines 47 to 54) whenever each one is set, so you get both.
What to do
- Clear
datawhen a check fails, in both the!res.okbranch and thecatch. Clearing it when a check starts would work too, but then the current report disappears while the next one loads. - Leave the address bar as it is: it only changes after a successful check (#146), and the tests on lines 201 and 220 of
tests/preview/query-params.test.tsexpect that. - A unit test isn't needed here. The hook tests (from line 116) render the hook with
renderToString, which doesn't show state changes aftercheckUrlruns, so describe your manual check in the PR instead.
Where to look
src/components/preview/usePreviewState.ts:checkUrl(lines 76 to 107)src/components/preview/PreviewApp.tsx: the error (lines 41 to 45) and the report (lines 47 to 54)tests/preview/query-params.test.ts: theusePreviewStatetests (from line 116)
Acceptance criteria
- After a successful check, a failed one shows only the error, with no report under it
- The same happens when the request itself fails (for example with the browser offline in DevTools)
- A successful check after a failed one shows the new report
-
npm run check,npm run testandnpm run buildpass - The PR says how you checked it with
npm run dev, with a screenshot of the error state
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #168 in the description.
- Lingua principale
- TypeScript
- Stelle
- 8
- Fork
- 4
- Merge medio
- 6h 9m
- PR unite (30g)
- 66
Preparare l'ambiente
- Nessun Dockerfile né 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 codercops/ogcops
-
accessibility bug good first issue hacktoberfest ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
accessibility bug good first issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
codercops/ogcops#167 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
An empty `imageUrl=`, `logoUrl=` or `template=` returns an error instead of the defaultForse già presa @Saifjafri212213 l’ha presa 1 giorno fa. Apertabug good first issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
codercops/ogcops#166 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
codercops/ogcops#164 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di codercops/ogcops
Issue simili
-
native
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
prime-radiant-inc/evener#4839 ·
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
processone/fluux-messenger#1790 ·
I maintainer di solito rispondono entro 1 giorno
-
🛣️ Infrastructure
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
opencrvs/opencrvs-core#14232 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
kunchenguid/gh-axi#220 ·
I maintainer di solito rispondono entro 1 giorno