You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Citations: navigating away mid-load fires a spurious "Failed to load citation data" toast #684
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.
The correct pattern is 15 lines below in the same file — the Competitor Gaps effect uses a cancelled flag and skips state writes after cleanup: page.tsx#L925-L945
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
fix(citations): don't toast a load failure after leaving the page (an…