Compare commits

...
Author SHA1 Message Date
Sonarly Claude Code cdf60deb23 Intermittent network failures on self-hosted instance cause token renewal failure and session logout
https://sonarly.com/issue/13837?type=bug

Intermittent `TypeError: Failed to fetch` errors on POST to `https://vedio.twenty.com/metadata` cause the token renewal flow to fail, logging the user out and redirecting to `/welcome`.
2026-03-12 17:44:18 +00:00
2 changed files with 21 additions and 1 deletions
@@ -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) => {
@@ -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);