Skip to content

fix(FON-178): magistrat modal shows deterministically#118

Merged
jquagliatini merged 2 commits into
developfrom
fix/FON-178-cant-open-magistrat-modal-randomly
Jan 6, 2026
Merged

fix(FON-178): magistrat modal shows deterministically#118
jquagliatini merged 2 commits into
developfrom
fix/FON-178-cant-open-magistrat-modal-randomly

Conversation

@jquagliatini
Copy link
Copy Markdown
Collaborator

No description provided.

export const useUser = () => {
const { data, ...query } = useQuery({
retry: 0,
staleTime: 10 * 60 * 1_000,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le bug a l'air de venir de cette query. Lorsque la donnée est stale (au bout de 10 secondes avant), cela déclenchait un re-fetch dans le AuthGuard donc tout en haut de l'abre des composants créant le problème observé.

Il y a un sujet sur la façon dont on considère cette query un peu particulière:

  1. Puisque l'on gère le 401 de façon globale, on peut peut-être accepter qu'elle soit permanente (staleTime: Infinity)
  2. On continue de refetchOnMount, mais en arrière plan, en acceptant de la donnée stale (je ne sais pas comment on fait ça, mais ça semble faisable). Probablement le plus safe.

@jquagliatini jquagliatini merged commit f59ea8e into develop Jan 6, 2026
6 checks passed
@jquagliatini jquagliatini deleted the fix/FON-178-cant-open-magistrat-modal-randomly branch January 6, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant