Bug: Duplicate QueryClient instance — queryClient.js is dead code #55
Labels
No Label
P0 Critical
P1 High
P2 Medium
P3 Low
accessibility
backend
bug
content
data-integrity
enhancement
frontend
infra
integration
owner
owner-input
performance
performance
phase-7
phase-8
security
seo
ui
ux
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Queue-North-Website#55
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
There are two separate
QueryClientinstances created:src/main.jsx(lines 9-14) — creates aQueryClientand passes it to<QueryClientProvider>. This is the active instance used by the app.src/lib/queryClient.js— creates anotherQueryClientwith the same config and exports it. This is never connected to any provider and is dead code.Additionally,
src/lib/api.jsimportsqueryClientfrom./queryClientbut never uses it in a way that would work with React Query's context system. The import is there but thequeryClientreference is only re-exported, never used forinvalidateQueriesor other imperative calls.Impact
queryClient.jsmodule creates a wastedQueryClientinstance on every importqueryClientfromapi.jsfor cache invalidation, it would operate on the wrong (disconnected) instanceapi.jsis misleadingFix
src/lib/queryClient.jsentirelyexport { queryClient }line fromsrc/lib/api.jsuseQueryClient()hook inside components instead