[#418] improved retry logic to prevent loading loop (#427)

* [#418] improved retry logic to prevent loading loop

* [#418] added FullJitter algorithm

Co-authored-by: Benoit TELLIER <btellier@linagora.com>
This commit is contained in:
Camille Moussu
2025-12-19 12:24:34 +01:00
committed by GitHub
parent 90d6058b0f
commit 6839353f34
5 changed files with 70 additions and 9 deletions
+4 -3
View File
@@ -1,7 +1,7 @@
import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
import ReplayIcon from "@mui/icons-material/Replay";
import { Box, Button, Fade, Paper, Stack, Typography } from "@mui/material";
import { useEffect } from "react";
import { useEffect, useRef } from "react";
import { push } from "redux-first-history";
import { useAppDispatch, useAppSelector } from "../../app/hooks";
import { useI18n } from "twake-i18n";
@@ -11,12 +11,13 @@ export function Error() {
const dispatch = useAppDispatch();
const userError = useAppSelector((state) => state.user.error);
const calendarError = useAppSelector((state) => state.calendars.error);
const initialUserError = useRef(userError);
useEffect(() => {
if (!userError) {
if (!initialUserError.current) {
dispatch(push("/"));
}
}, [calendarError, dispatch]);
}, [dispatch]);
const errorMessage = userError || calendarError || t("error.unknown");