Files
Cursor Agent 1f7fcb707e Fix race condition navigating to stale thread on Electron app launch
In Electron mode, readPersistedState() was setting threadsHydrated: true
immediately when restoring threads from localStorage, before
DesktopProjectBootstrap could run SYNC_PROJECTS to filter out threads
whose projects no longer exist. This caused a flash where users would
briefly see a stale thread view before being redirected to /.

Two changes:
- readPersistedState() now always sets threadsHydrated: false, deferring
  to the bootstrap components to set it true after validation.
- _chat.tsx layout effect now checks threadsHydrated before navigating to
  the persisted activeThreadId, preventing premature navigation.
2026-02-18 18:07:38 +00:00
..