Demo mode destroys the user's real data permanently #18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug: Demo mode destroys the user's real data permanentlyto Demo mode destroys the user's real data permanently@claude take a look and fix it please. push to a branch and create a PR and i'll take a look
Fixed: demo mode was silently overwriting real user data
Root cause (
src/core/store/appStore.ts):persistState()tried to figure out which data was "real" vs. demo by re-readinguseAppStore.getState()— but that's the exact same in-memory store that had just been overwritten withMOCK_DEEDS/fake demo logs when demo mode turned on. The check was circular, not an actual fallback to disk. So any store action while demo mode was active (logging a prayer, adding a deed, etc.) wrote the fake demo data straight to disk, permanently overwriting the user's real save file. Turning demo mode back off then reloaded from disk — which now only held demo data — so the user's real deeds/logs were gone for good.Fix: added a
realDeeds/realLogsslice to the store that holds the user's actual data and is never touched while demo mode is on. All mutating actions route through a small helper that updates the displayeddeeds/logsalways, but only syncsrealDeeds/realLogswhen demo mode is off.persistState()now always writes fromrealDeeds/realLogs, so demo data can never reach disk.Verified
npm run checks:tscandnpm run checks:lintpass (only pre-existing, unrelated formatting warnings).Pushed to branch
claude/fix-demo-mode-data-lossand opened PR: #22