Skip to content

fix(frontend): refresh migrated-files list after upload (#64) - #73

Merged
amar-python merged 1 commit into
mainfrom
fix/issue-64-files-refresh
Oct 25, 2026
Merged

amar-python merged 1 commit into
mainfrom
fix/issue-64-files-refresh

Conversation

@amar-python

Copy link
Copy Markdown
Owner

Fixes #64.

Cause

The home route loader called queryClient.ensureQueryData(filesQuery). When data is already cached, that returns the cached data without refetching. So router.invalidate() after an upload re-ran the loader but got the old list back, and the new file only appeared after navigating away and back.

Fix

  • filesQuery moves to src/lib/csv.functions.ts, next to listCsvFiles.
  • New loadFiles(queryClient) calls ensureQueryData with revalidateIfStale: true. With the default staleTime of 0, every loader run refetches.
  • The route loader uses loadFiles.

The fix sits in the loader, so it covers every router.invalidate() caller, not only the upload path.

Evidence

  • npx vitest run: 7 files, 96 tests passed (95 before, plus 1 new).
  • The new test src/__tests__/files-refresh.test.ts fails with revalidateIfStale removed and passes with it.
  • ESLint error count on the changed files is unchanged from main. The remaining errors are pre-existing.
  • Not checked in a browser.

Generated by Claude Code

The home route loader used ensureQueryData, which returns cached data, so
router.invalidate() after an upload never refetched the list. The loader
now passes revalidateIfStale so the list refetches on every loader run.

Adds a regression test that fails without the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019YPoXzBSj89ZHgw7nfTmbB
@amar-python amar-python added this to the Frontend and UI milestone Oct 25, 2026 — with Claude
@amar-python amar-python added the bug Something isn't working label Oct 25, 2026 — with Claude
@amar-python
amar-python merged commit da85313 into main Oct 25, 2026
3 checks passed
amar-python added a commit that referenced this pull request Oct 25, 2026
docs(readme): vitest count is 102 after #73 and #74
@amar-python
amar-python deleted the fix/issue-64-files-refresh branch October 27, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend: migrated-files list does not refresh after upload

2 participants