fix(app): handle CancelledError from cancelled provider usage queries (#1885)

Move canFetch guard before first await so disabled refresh bails out synchronously instead of entering async path. Add .catch() swallow for fire-and-forget call to prevent unhandled promise rejections when react-query cancels pending queries during rapid tooltip open/close cycles.
This commit is contained in:
Slava Goltser
2026-07-09 05:00:57 +08:00
committed by GitHub
parent 202c417347
commit c7406a415d
2 changed files with 2 additions and 4 deletions
@@ -58,10 +58,8 @@ export function useProviderUsage(
});
const refresh = useCallback(async () => {
if (!canFetch) return;
await queryClient.invalidateQueries({ queryKey });
if (!canFetch) {
return;
}
await queryClient.fetchQuery({
queryKey,
queryFn,