Compare commits

...

3 Commits

Author SHA1 Message Date
lebaudantoine 2e33052516 wip to be discuss 2026-09-04 14:19:54 +02:00
lebaudantoine b9ef6e6eb3 wip avoid redirect while calling /me on the backend 2026-09-04 14:13:15 +02:00
lebaudantoine 071d2b4de7 wip increase the lobby polling interval
goal is to reduce pressure on the backend (should be around ~60% capacity reduction on that endpoint)
2026-09-04 14:09:38 +02:00
2 changed files with 3 additions and 3 deletions
@@ -18,7 +18,7 @@ export const fetchUser = (
}
): Promise<ApiUser | false> => {
return new Promise((resolve, reject) => {
fetchApi<ApiUser>('/users/me')
fetchApi<ApiUser>('/users/me/')
.then(resolve)
.catch((error) => {
// we assume that a 401 means the user is not logged in
@@ -12,7 +12,7 @@ import { keys } from '@/api/queryKeys'
import { queryClient } from '@/api/queryClient'
import { ApiError } from '@/api/ApiError'
export const POLL_INTERVAL_MS = 1000
export const POLL_INTERVAL_MS = 3000
export const LAZY_POLL_INTERVAL_MS = 10_000
export const LobbyProvider = () => {
@@ -37,7 +37,7 @@ export const LobbyProvider = () => {
if (isParticipantsOpen) return POLL_INTERVAL_MS
return LAZY_POLL_INTERVAL_MS
},
refetchIntervalInBackground: true,
refetchIntervalInBackground: false,
})
// Triggers: each one-shot, idempotent, deduped by React Query if