Context
Follow-up from a broader useQuery audit during PR #107 review. Four hooks are called unconditionally (no real enabled: gating, no deliberate inline error/loading UI) for data that's either already prefetched by a route loader, or easily could be — good candidates for the loader-prefetch + useSuspenseQuery pattern used elsewhere in this codebase.
Candidates
useGroupMembersQuery (src/api/groups/useGroupMembers.ts, called from useSetFiltering.ts) — already prefetched by the group route loader (groups/$groupSlug.tsx).
useUserGroupsQuery (src/api/groups/useUserGroups.ts, called from SetGroupVoting.tsx) — same data the /groups/ route loader already prefetches via userGroupsQuery; this call site duplicates it without Suspense.
useFestivalsQuery (src/api/festivals/useFestivals.ts, called from FestivalSelection.tsx) — core content of the festival-selection page, unconditionally required; no loader currently prefetches it (would need one added).
useGenresQuery (src/api/genres/useGenres.ts, called from GenreBadge and AddArtistDialog) — already prefetched by the sets route loader (sets/index.tsx); these call sites duplicate it.
Out of scope here
useStageQuery per-item flicker — tracked separately in #108.
Confirmed NOT candidates (checked, correctly plain useQuery): vote queries, invite validation, custom links, profile/permissions, duplicate-artists, admin roles, soundcloud playlist, analytics table — all have genuine enabled: conditions or deliberately show inline error/loading UI instead of throwing to Suspense.
Bonus finding — separate cleanup, not part of this issue
9 wrapper hooks appear to be dead code (never called anywhere; everything already reads their queryOptions factory directly via ensureQueryData/useSuspenseQuery): useSetBySlugQuery, useGroupInvitesQuery, useGroupBySlugQuery, useGroupDetailQuery, useFestivalQuery, useFestivalEditionQuery, useArtistQuery, useArtistBySlugQuery, useArtistNotesQuery. Worth a human check to confirm truly unused before deleting — tracked in #109.
Flagged during PR #107 review, not fixed there to keep that PR scoped to the loader-await change.
Context
Follow-up from a broader
useQueryaudit during PR #107 review. Four hooks are called unconditionally (no realenabled:gating, no deliberate inline error/loading UI) for data that's either already prefetched by a route loader, or easily could be — good candidates for the loader-prefetch +useSuspenseQuerypattern used elsewhere in this codebase.Candidates
useGroupMembersQuery(src/api/groups/useGroupMembers.ts, called fromuseSetFiltering.ts) — already prefetched by the group route loader (groups/$groupSlug.tsx).useUserGroupsQuery(src/api/groups/useUserGroups.ts, called fromSetGroupVoting.tsx) — same data the/groups/route loader already prefetches viauserGroupsQuery; this call site duplicates it without Suspense.useFestivalsQuery(src/api/festivals/useFestivals.ts, called fromFestivalSelection.tsx) — core content of the festival-selection page, unconditionally required; no loader currently prefetches it (would need one added).useGenresQuery(src/api/genres/useGenres.ts, called fromGenreBadgeandAddArtistDialog) — already prefetched by the sets route loader (sets/index.tsx); these call sites duplicate it.Out of scope here
useStageQueryper-item flicker — tracked separately in #108.Confirmed NOT candidates (checked, correctly plain
useQuery): vote queries, invite validation, custom links, profile/permissions, duplicate-artists, admin roles, soundcloud playlist, analytics table — all have genuineenabled:conditions or deliberately show inline error/loading UI instead of throwing to Suspense.Bonus finding — separate cleanup, not part of this issue
9 wrapper hooks appear to be dead code (never called anywhere; everything already reads their
queryOptionsfactory directly viaensureQueryData/useSuspenseQuery):useSetBySlugQuery,useGroupInvitesQuery,useGroupBySlugQuery,useGroupDetailQuery,useFestivalQuery,useFestivalEditionQuery,useArtistQuery,useArtistBySlugQuery,useArtistNotesQuery. Worth a human check to confirm truly unused before deleting — tracked in #109.Flagged during PR #107 review, not fixed there to keep that PR scoped to the loader-await change.