Handle transient network suspension in frontend polling and SSE

This commit is contained in:
Smittix
2026-02-24 22:25:59 +00:00
parent 636ca84282
commit 2ef6dfe472
5 changed files with 78 additions and 7 deletions
+6 -1
View File
@@ -971,7 +971,12 @@
}
}
} catch (err) {
console.error('Position update error:', err);
const transient = (typeof window.isTransientOrOffline === 'function' && window.isTransientOrOffline(err)) ||
(typeof navigator !== 'undefined' && navigator.onLine === false) ||
/failed to fetch|network io suspended|networkerror|timeout/i.test(String((err && err.message) || err || ''));
if (!transient) {
console.error('Position update error:', err);
}
}
}