From 707889950deb44e0d2bb61626e684fca474eb056 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 18 Feb 2026 05:27:53 +0000 Subject: [PATCH] Fix: remove bootstrapStartedRef that deadlocks persistence in StrictMode The bootstrapStartedRef guard prevented the second StrictMode effect invocation from running, while the first invocation's async work saw disposed=true and skipped setPersistenceReady(true). This left persistenceReady permanently false, disabling state loading and persistence during development. The disposed flag alone correctly handles cleanup of stale effect invocations, making the ref guard unnecessary. --- apps/web/src/store.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apps/web/src/store.ts b/apps/web/src/store.ts index 633d583104..7735e8e36c 100644 --- a/apps/web/src/store.ts +++ b/apps/web/src/store.ts @@ -858,13 +858,9 @@ const StoreContext = createContext<{ export function StoreProvider({ children }: { children: ReactNode }) { const [state, dispatch] = useReducer(reducer, initialState); const [persistenceReady, setPersistenceReady] = useState(false); - const bootstrapStartedRef = useRef(false); const lastPersistedStateJsonRef = useRef(null); useEffect(() => { - if (bootstrapStartedRef.current) return; - bootstrapStartedRef.current = true; - let disposed = false; const api = readNativeApi(); if (!api) {