fix: pr-bug-scan findings from #1452 (#1560)

Co-authored-by: orca-bug-scan-bot <orca-bug-scan-bot@stably.ai>
This commit is contained in:
buf0-bot[bot]
2026-05-07 22:18:17 -07:00
committed by GitHub
co-authored by orca-bug-scan-bot
parent 493f08bfa5
commit 5e8f796200
+10 -1
View File
@@ -70,7 +70,16 @@ async function doLoadHosts(): Promise<HostProfile[]> {
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