diff --git a/mobile/src/transport/host-store.ts b/mobile/src/transport/host-store.ts index 119e10d7c..13fd665e4 100644 --- a/mobile/src/transport/host-store.ts +++ b/mobile/src/transport/host-store.ts @@ -70,7 +70,16 @@ async function doLoadHosts(): Promise { let token = tokenCache.get(stored.data.id) if (!token) { - const fetched = await SecureStore.getItemAsync(tokenKey(stored.data.id), KEYCHAIN_OPTIONS) + let fetched: string | null + try { + fetched = await SecureStore.getItemAsync(tokenKey(stored.data.id), KEYCHAIN_OPTIONS) + } catch { + // Why: a transient Keychain failure for one entry (e.g. + // errSecInteractionNotAllowed while the device is briefly locked, + // or a single corrupt record) must not blank the entire host list. + // Skip just this host — it'll reappear on the next load. + continue + } if (!fetched) { // Why: orphaned metadata with no matching keychain entry — most // likely a stale record from a development install. Skip it