Skip to content

Simplify FestivalEditionProvider error handling (remove unreachable navigate + error UI) #83

Description

@chiptus

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions