The preview page keeps showing the previous report after a check fails
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
調査の方向性
src/components/preview/usePreviewState.tsを読み、checkUrlの失敗分岐を追ってください。src/components/preview/PreviewApp.tsxでは、エラーとレポートがどのように表示されるかを確認できます。成功するURLの後に404とリクエスト失敗を手動で確認し、その後もう一度成功するチェックを行ってください。失敗したチェックではエラーだけが表示され、その後の成功ではレポートが表示され、PRにnpm run devでの確認結果とスクリーンショットが記載されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 8
- フォーク
- 4
- 平均マージ
- 5時間 44分
- マージ済み PR(30日)
- 83
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/ogcops のほかの issue
-
Add the Order Status e-commerce template (`ecommerce-order-status`)対応中かも @piyusshhjangid が今日担当しました。 オープンgood first issue hacktoberfest templates
codercops/ogcops#181 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Add the Cheat Sheet tutorial template (`tutorial-cheat-sheet`)対応中かも @srikar-naidu が今日担当しました。 オープンhacktoberfest help wanted templates
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
codercops/ogcops#180 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Add the Call for Speakers event template (`event-call-for-speakers`)対応中かも @Saifjafri212213 が今日担当しました。 オープンgood first issue hacktoberfest templates
codercops/ogcops#177 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Add the Day Streak developer template (`developer-day-streak`)対応中かも @srikar-naidu が今日担当しました。 オープンhacktoberfest help wanted templates
codercops/ogcops#176 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
hacktoberfest
難易度 1/5 1時間未満 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
codercops/ogcops の issue をすべて見る
似ている issue
-
数据界面的横向滚动条缺失オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
zilliztech/attu#1037 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openclaw/openclaw#181212 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apify/apify-mcp-server#1684 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Automattic/data-liberation-agent#953 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
siteboon/claudecodeui#1642 ·
メンテナーはふだん 5 日以内に返信