perf: reduce background return latency via session caching and async map rendering

This commit is contained in:
2026-03-04 10:43:58 -05:00
parent 90bb93be17
commit b89de437b2
3 changed files with 8 additions and 5 deletions

View File

@ -44,7 +44,7 @@ async function dispatchRefocus(reason: string) {
const timeoutMs = 5000
const refreshWithTimeout = Promise.race([
supabase.auth.refreshSession(),
supabase.auth.getSession(), // Usa caché interno si el token no ha expirado, previene delays innecesarios HTTP de 1-3 segundos
new Promise((_, reject) =>
setTimeout(() => reject(new Error("Auth refresh timeout")), timeoutMs)
)