fix: suppress unhandled promise rejections from fire-and-forget useEffect loads

useAsync re-throws errors after storing them in state — correct for awaited
callers but causes unhandled rejections when load() is called without .catch()
in useEffects. The error is already captured in AsyncState.Error so the
re-throw provides no additional value in these fire-and-forget patterns.

Fixes JAVASCRIPT-REACT-M (Sentry: Media download failed: 401 Unauthorized)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-02 10:01:04 -04:00
parent 0bbfe17559
commit 7bafefa5e7
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ export function ClientConfigLoader({ fallback, error, children }: ClientConfigLo
const ignoreCallback = useCallback(() => setIgnoreError(true), []);
useEffect(() => {
load();
void load().catch(() => undefined);
}, [load]);
if (state.status === AsyncStatus.Idle || state.status === AsyncStatus.Loading) {