Skip to content

Citations: navigating away mid-load fires a spurious "Failed to load citation data" toast #684

Closed

Description

@gkhngyk

Problem

Leave the Citations page while its initial load is still running (easy to hit — the overview scan takes seconds, see #657) and a "Failed to load citation data" error toast pops up on whatever page you navigated to. Nothing actually failed: navigation aborted the in-flight request, but loadData's catch treats every rejection as a real error and fires a global toast. It also writes setLoadFailed(true) after unmount.

Evidence

Fix

  • Move the loadData call into an effect with a cleanup-scoped cancelled flag (mirror the gaps effect right below it) so a stale response or rejection can't write state or toast after the user has left.
  • In the catch, only surface real failures: skip toast + setLoadFailed when the request was cancelled/aborted or the effect has been cleaned up.

Related: #663 is the same bug class on the Content page (stale-response guard); #656 touches the same loadData for the refetch UX — coordinate if both are in flight.

Acceptance criteria

  • Navigating away mid-load never shows the failure toast on the destination page.
  • Real load failures (with the page still open) still toast and set the failed state.
  • Rapid filter changes don't let an older response overwrite a newer one.

Activity

  1. added
    bug
    good first issue
    on Aug 8, 2026
  2. added a commit that references this issue on Aug 10, 2026
    bb8af98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions