From d8c3a6c57c5196d992dd508b98c3137996ecfac6 Mon Sep 17 00:00:00 2001 From: bonamin Date: Tue, 17 Nov 2026 09:08:38 +0200 Subject: [PATCH] fix(access): the bootstrap request gets an 8 s time limit A bootstrap request that never answered (seen on the Android emulator after a cold start with the server down) left the app on its loading screen for good: no error, so no retry. It now times out, counts as offline (cached bootstrap / offline screen) and is retried, so the app comes back by itself when the server does. Co-Authored-By: Claude Opus 5.5 --- packages/access/src/AccessProvider.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/access/src/AccessProvider.jsx b/packages/access/src/AccessProvider.jsx index a27a106..9817191 100644 --- a/packages/access/src/AccessProvider.jsx +++ b/packages/access/src/AccessProvider.jsx @@ -31,6 +31,7 @@ import { OverrideHost } from './OverrideHost.jsx' * error with Retry. */ const CACHE_RETRY_MS = 15_000 +const BOOTSTRAP_TIMEOUT_MS = 8_000 export function AccessProvider({ client, token = null, i18n, deviceLanguage, override = true, loading, autoRetryMs = 0, cache, failed, children, @@ -44,7 +45,9 @@ export function AccessProvider({ } } try { - const { data } = await client.get('/api/platform/bootstrap', { xenia: { ignoreUnauthorized: true, noOverride: true } }) + // a time limit: a request that never answers (a half-dead link) must not leave the app on + // its loading screen for good; it counts as offline and is retried (4.6, Android e2e) + const { data } = await client.get('/api/platform/bootstrap', { timeout: BOOTSTRAP_TIMEOUT_MS, xenia: { ignoreUnauthorized: true, noOverride: true } }) await apply(data) try { cache?.save(token, data) } catch { /* storage full or blocked: still works online */ } setState({ data, forToken: token, error: null, offline: false })