perf: reduce background return latency via session caching and async map rendering
This commit is contained in:
@ -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)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user