- assigned_to: BilgeGates
Originally created by: BilgeGates
Originally owned by: BilgeGates
useHistoryHydration checks isMountedRef.current before calling setState, but the async syncStorage.get() promise is already in flight at unmount time. The state update can still fire because the check races with the in-flight promise resolving after the ref is set to false.
File: src/shared/hooks/fenHistory/useHistoryHydration.ts
No state updates fire after the component unmounts.
The isMounted check races with the in-flight promise — state update can still fire after unmount.
The isMounted pattern doesn't cancel in-flight promises. An AbortController or a cancellation flag checked inside the promise chain (not after await) is needed.
Any browser / OS — reproducible in Chrome on desktop with slow network throttling.