Fresh installs ship with fake prayer logs #19

Closed
opened 2026-08-30 20:12:56 +00:00 by uwayss · 2 comments
Owner

in appStore.ts and data/mock.ts

The Stats screen and activity graph show five hardcoded logs dated 2025-08-28/2025-08-29 in first launch. Should be [].

in appStore.ts and data/mock.ts The Stats screen and activity graph show five hardcoded logs dated 2025-08-28/2025-08-29 in first launch. Should be [].
Author
Owner

@claude i found this in the code but can you verify it pls i might be wrong

@claude i found this in the code but can you verify it pls i might be wrong
Collaborator

Pushed. Here's the reply for the issue:

Confirmed — you found it

The bug is in initialize() in src/core/store/appStore.ts:

let initialLogs = MOCK_LOGS;   // default, used before checking loadedData

if (loadedData) {
  ...
  initialLogs = loadedData.logs;
}

On a fresh install there's no loadedData, so initialLogs stays at MOCK_LOGS — the five hardcoded logs dated 2025-08-28/2025-08-29 from src/core/data/mock.ts. That's why the Stats screen and activity graph show fake activity on first launch instead of an empty state.

(MOCK_DEEDS, the actual list of prayer definitions like Fajr/Dhuhr/etc., is fine to default to — that's real app data, not fake demo history.)

Fix

Pushed to branch claude/fix-fresh-install-fake-logs-19:

  • Default initialLogs to [] instead of MOCK_LOGS.
  • Removed MOCK_LOGS (now unused) from mock.ts.

Verified tsc --noEmit and expo lint both pass clean (only pre-existing, unrelated warnings remain in other files).

Pushed. Here's the reply for the issue: ## Confirmed — you found it The bug is in `initialize()` in `src/core/store/appStore.ts`: ```ts let initialLogs = MOCK_LOGS; // default, used before checking loadedData if (loadedData) { ... initialLogs = loadedData.logs; } ``` On a fresh install there's no `loadedData`, so `initialLogs` stays at `MOCK_LOGS` — the five hardcoded logs dated `2025-08-28`/`2025-08-29` from `src/core/data/mock.ts`. That's why the Stats screen and activity graph show fake activity on first launch instead of an empty state. (`MOCK_DEEDS`, the actual list of prayer definitions like Fajr/Dhuhr/etc., is fine to default to — that's real app data, not fake demo history.) ## Fix Pushed to branch `claude/fix-fresh-install-fake-logs-19`: - Default `initialLogs` to `[]` instead of `MOCK_LOGS`. - Removed `MOCK_LOGS` (now unused) from `mock.ts`. Verified `tsc --noEmit` and `expo lint` both pass clean (only pre-existing, unrelated warnings remain in other files).
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
uwayss/muhsin#19
No description provided.