This was generated by AI during triage.
Split from #27 (item 4 of 6).
Problem
FestivalEditionProvider renders an error UI and navigates away via useEffect on editionQuery.error, causing a flash before redirect. This path is unreachable: the edition is preloaded in the route's beforeLoad, so a failed load throws before the provider ever renders.
Verified:
src/contexts/FestivalEditionContext.tsx:53-62 — error useEffect → toast + navigate({ to: "/" })
src/contexts/FestivalEditionContext.tsx:64-77 — error-UI early return
src/routes/festivals/$festivalSlug/editions/$editionSlug.tsx does call context.queryClient.ensureQueryData(editionBySlugQuery(...)) in beforeLoad → confirms the error can't reach the provider.
Fix
- Remove the error
useEffect (L53-62) and the error-UI early return (L64-77).
- Keep the normal render; let route-level error boundaries handle real load failures.
- Drop now-unused imports if nothing else uses them (
useEffect, useNavigate, useToast, TopBar).
Acceptance
- Provider compiles with no unused-import/lint errors.
- Normal edition load path unchanged; no behavior change for a successful load.
Files
src/contexts/FestivalEditionContext.tsx
Split from #27 (item 4 of 6).
Problem
FestivalEditionProviderrenders an error UI and navigates away viauseEffectoneditionQuery.error, causing a flash before redirect. This path is unreachable: the edition is preloaded in the route'sbeforeLoad, so a failed load throws before the provider ever renders.Verified:
src/contexts/FestivalEditionContext.tsx:53-62— erroruseEffect→ toast +navigate({ to: "/" })src/contexts/FestivalEditionContext.tsx:64-77— error-UI early returnsrc/routes/festivals/$festivalSlug/editions/$editionSlug.tsxdoes callcontext.queryClient.ensureQueryData(editionBySlugQuery(...))inbeforeLoad→ confirms the error can't reach the provider.Fix
useEffect(L53-62) and the error-UI early return (L64-77).useEffect,useNavigate,useToast,TopBar).Acceptance
Files
src/contexts/FestivalEditionContext.tsx