InnerHue leverages browser localStorage as its primary database tier to save historical emotion logs and daily tracking streaks across local client sessions. However, the current context provider state machine inside frontend/src/context/MoodContext.tsx only updates memory states during local, in-app component events.
If a user keeps multiple tabs of the platform open at the same time (e.g., keeping an analytics dashboard open on one tab while saving a new mood entry on a journal form in another), the underlying data models fall out of sync. Writing updates in Tab A fails to alert the state tree inside Tab B. This creates a data race condition that overrides entry histories or corrupts dashboard tracking metrics upon page reload.
InnerHue leverages browser
localStorageas its primary database tier to save historical emotion logs and daily tracking streaks across local client sessions. However, the current context provider state machine insidefrontend/src/context/MoodContext.tsxonly updates memory states during local, in-app component events.If a user keeps multiple tabs of the platform open at the same time (e.g., keeping an analytics dashboard open on one tab while saving a new mood entry on a journal form in another), the underlying data models fall out of sync. Writing updates in Tab A fails to alert the state tree inside Tab B. This creates a data race condition that overrides entry histories or corrupts dashboard tracking metrics upon page reload.