stablyai/orca · error · Error
Session view overrides could not be read
Error message
Session view overrides could not be read
What it means
Thrown by `updateSessionViewOverride` when the prerequisite read of existing overrides fails. `readSessionViewOverridesStorage` returns `loaded: false` only when `AsyncStorage.getItem` itself throws; the update then refuses to proceed because writing a single-tab map would overwrite the other tabs' valid saved overrides with an incomplete snapshot. The shared `overrideUpdateBarriers` chain serialises writes per host/worktree key.
Source
Thrown at mobile/src/storage/session-view-preferences.ts:142
await overrideUpdateBarriers.get(key)
return readSessionViewOverridesStorage(key)
}
/** Persists one user mutation without replacing sibling overrides from another mount. */
export async function updateSessionViewOverride(
hostId: string,
worktreeId: string,
tabId: string,
view: MobileSessionView
): Promise<void> {
const key = sessionViewOverridesKey(hostId, worktreeId)
const previous = overrideUpdateBarriers.get(key) ?? Promise.resolve()
const update = previous.then(async () => {
const current = await readSessionViewOverridesStorage(key)
// Why: a transient read failure must not replace valid saved siblings with
// a partial map containing only the latest tab.
if (!current.loaded) {
throw new Error('Session view overrides could not be read')
}
current.overrides.set(tabId, view)
await AsyncStorage.setItem(key, JSON.stringify(Object.fromEntries(current.overrides)))
})
const barrier = update.catch(() => undefined)
overrideUpdateBarriers.set(key, barrier)
try {
await update
} finally {
if (overrideUpdateBarriers.get(key) === barrier) {
overrideUpdateBarriers.delete(key)
}
}
}
View on GitHub (pinned to 1136503c6a)
Solutions
- Retry the toggle — transient storage I/O often succeeds on the next attempt.
- Free device storage / restart the app to clear a transient AsyncStorage fault.
- If it persists, the storage backend may need the app's cache cleared (data itself is safe to lose for view preferences).
- Verify no other code is holding/corrupting the `orca:nativeChatTabs:` key namespace.
Defensive patterns
Strategy: try-catch
Try / catch
// updateSessionViewOverride already serialises via overrideUpdateBarriers and
// swallows the barrier rejection; callers should retry on transient I/O failure.
try {
await updateSessionViewOverride(hostId, worktreeId, tabId, view)
} catch (err) {
if (err instanceof Error && err.message === 'Session view overrides could not be read') {
await wait(200)
await updateSessionViewOverride(hostId, worktreeId, tabId, view)
} else throw err
} Prevention
- Never overwrite the overrides map when the read failed — it would erase sibling tabs (the guard enforces this).
- Retry transient AsyncStorage I/O rather than dropping sibling overrides.
- Keep the overrideUpdateBarriers chain intact so concurrent mounts don't interleave reads/writes.
When it happens
Trigger: Toggling a tab's session view (terminal↔chat) where reading the current overrides map from AsyncStorage throws — native storage I/O error, disk full, keychain/storage backend unavailable on the OS.
Common situations: Disk pressure or filesystem error on the device; AsyncStorage backend corruption; an OS-level permission issue accessing the app's storage sandbox; a transient I/O fault during heavy memory pressure.
Related errors
- Codex reset attempt journal is unreadable
- mobile relay host overlay storage unreadable
- Codex reset attempt idempotency key is invalid
- Codex reset attempt journal identity changed
- pending host credential cleanup storage unreadable
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/ef0fd28c8053c643.
Report an issue: GitHub.