fix: Analyst ratings abort without reason on overview page

- trpcQuery/trpcMutate now throw 'Request timed out (8s)' instead of
  generic 'The operation was aborted.' so users know WHY the request failed
- AnalystRatings adds cancelled guard (race condition fix) so stale
  promise results from symbol changes are ignored (matches OverviewPanel
  pattern)
- Add Retry button on error state for timeout or other failures
- useEffect cleanup returns cancelled flag setter
This commit is contained in:
Investor Flow Build
2026-07-25 11:42:33 -04:00
parent 7492317ebb
commit 8b51d16d7b
2 changed files with 27 additions and 4 deletions
+10
View File
@@ -396,6 +396,11 @@ async function trpcQuery<T>(procedure: string, input?: unknown): Promise<T> {
signal: controller.signal,
});
return parse<T>(res);
} catch (e) {
if (e instanceof DOMException && e.name === "AbortError") {
throw new Error(`Request timed out (${TRPC_TIMEOUT_MS / 1000}s)`);
}
throw e;
} finally {
clearTimeout(timer);
}
@@ -413,6 +418,11 @@ async function trpcMutate<T>(procedure: string, input: unknown): Promise<T> {
signal: controller.signal,
});
return parse<T>(res);
} catch (e) {
if (e instanceof DOMException && e.name === "AbortError") {
throw new Error(`Request timed out (${TRPC_TIMEOUT_MS / 1000}s)`);
}
throw e;
} finally {
clearTimeout(timer);
}