From 5e8f7962006c202c7fad008b8adb43b2cbe97edb Mon Sep 17 00:00:00 2001 From: "buf0-bot[bot]" <252831055+buf0-bot[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 22:18:17 -0700 Subject: [PATCH] fix: pr-bug-scan findings from #1452 (#1560) Co-authored-by: orca-bug-scan-bot --- mobile/src/transport/host-store.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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