Skip to content

fix(health): surface a fetch error in TestsReachingList - #2632

Merged
RaghavChamadiya merged 1 commit into
repowise-dev:mainfrom
drakeo338:claude/2624-fix
Oct 1, 2026
Merged

RaghavChamadiya merged 1 commit into
repowise-dev:mainfrom
drakeo338:claude/2624-fix

Conversation

@drakeo338

Copy link
Copy Markdown

Summary

TestsReachingList caught a rejected fetch into null, so a failed request rendered the same "no test reaches this file" sentence as a genuine empty answer. This change lets the fetch failure set an error state instead, so a 500 or a network error shows a distinct "could not load" message rather than the empty-graph answer.

There's a related spot worth a separate look: health_tests_reaching in coverage_routes.py:359 still folds a graph-walk exception into the same basis: "none" shape as a real empty answer, matching this file's own convention elsewhere, so the new client error state can't fire for that server-side case. I left it out of this PR since it would change an established convention the issue doesn't ask for, and the UI conflation this PR fixes holds regardless.

Fixes #2624.

Related Issues

Fixes #2624

Test Plan

Run from packages/ui: npx vitest run __tests__/health/inferred-tests.test.tsx

  • Tests pass (pytest)
  • Lint passes (ruff check .)
  • Web build passes (npm run build) (if frontend changes)

Checklist

  • My code follows the project's code style
  • I have added tests for new functionality
  • All existing tests still pass
  • I have updated documentation if needed

The fetcher's rejection was swallowed with .catch(() => null), which
made a failed request render the same "nothing reaches this file"
sentence as a genuine static-analysis answer. Let the rejection reach
SWR's error state and show a distinct "could not load" message instead,
so a fetch failure is never read as evidence the file is untested.
@repowise-bot

repowise-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

Reviewed the whole diff: nothing to fix.

⚠️ Health of changed files: 9.0 → 8.9 (-0.1)

👀 Suggested reviewers @RaghavChamadiya


📊 See the full report for this PR
Your repo map with this PR's blast radius lit up, every caller of the contracts it changes, and health before and after. No sign-in. · Reviewed with AI · Plain markdown for agents · ⭐ Star Repowise · 📥 Install bot · Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings/bot · Updated 2026-09-28 08:52 UTC

@RaghavChamadiya RaghavChamadiya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @drakeo338. Dropping the .catch(() => null) also brings the useSWR type back in line with what the fetcher prop actually promises, and the negative assertion that the empty-state text no longer renders is the check that matters. Agreed the server-side basis: "none" fold is a separate question.

@RaghavChamadiya
RaghavChamadiya merged commit eb1d2ae into repowise-dev:main Oct 1, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The file page's Tests tab says no test reaches a file when the request for that answer failed

2 participants