diff --git a/packages/twenty-front/src/modules/error-handler/components/PromiseRejectionEffect.tsx b/packages/twenty-front/src/modules/error-handler/components/PromiseRejectionEffect.tsx index a17f6a76646..4ebbb5648ac 100644 --- a/packages/twenty-front/src/modules/error-handler/components/PromiseRejectionEffect.tsx +++ b/packages/twenty-front/src/modules/error-handler/components/PromiseRejectionEffect.tsx @@ -27,10 +27,22 @@ export const PromiseRejectionEffect = () => { error.networkError?.name === 'AbortError' || error.name === 'AbortError'; - if (!isAbortError) { + // Transient network errors (Failed to fetch, Load failed) from Apollo + // are not actionable — typically caused by unstable connectivity or + // browser tab backgrounding. Skip both the snackbar and Sentry. + const isTransientNetworkError = + error.name === 'ApolloError' && + isEmpty(error.graphQLErrors) && + error.networkError?.name === 'TypeError'; + + if (!isAbortError && !isTransientNetworkError) { enqueueErrorSnackBar({}); } + if (isTransientNetworkError) { + return; + } + try { const { captureException } = await import('@sentry/react'); captureException(error, (scope) => { diff --git a/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx b/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx index f90cabcecbc..1beecb2fa4f 100644 --- a/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx +++ b/packages/twenty-front/src/modules/error-handler/components/SentryInitEffect.tsx @@ -54,6 +54,14 @@ export const SentryInitEffect = () => { tracesSampleRate: 1.0, replaysSessionSampleRate: 0.1, replaysOnErrorSampleRate: 1.0, + ignoreErrors: [ + // Transient network errors from Apollo — not actionable, + // typically caused by unstable connectivity on self-hosted + // instances or browser tab backgrounding. + 'Failed to fetch', + 'NetworkError when attempting to fetch resource', + 'Load failed', + ], }); setIsSentryInitialized(true);