mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-11 14:27:40 +01:00
The active session (which set you are on, and the reps done so far) lived only in app-private SQLite. An uninstall — or `pm clear`, which sounds harmless and is not — wipes that, so a user standing mid-workout loses the exact set and rep they were on. `backup.json` did not help: it mirrors only COMPLETED history. This is not hypothetical; it happened, mid-workout, and the state had to be re-entered by hand. Persistence granularity was already right (saveActiveSession fires on every set tap, untap, warmup and break change, storing `tapped` + `doneReps`). Only the LOCATION was wrong, so this mirrors it the same way the sync token already is: - BackupService.exportActiveSession/readActiveSession keep /sdcard/WorkoutTracker/active_session.json; a null export clears it. - StorageService.saveActiveSession mirrors on every write; loadActiveSession falls back to the mirror and re-seeds the table when it is empty — exactly the state after a wipe; clearActiveSession clears the mirror too, so a finished workout is never resurrected. - Both reads are defensive: a truncated/non-object mirror (battery death mid-set) is ignored rather than bricking the resume. Tested by simulating the wipe in the suite (resetForTesting + fresh init with the mirror intact), not on a real device holding real data. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fv8ULVt3Q67GwCFbM7doHB |
||
|---|---|---|
| .. | ||
| android | ||
| assets/sounds | ||
| lib | ||
| test | ||
| .gitignore | ||
| .metadata | ||
| analysis_options.yaml | ||
| CONTEXT.md | ||
| pubspec.lock | ||
| pubspec.yaml | ||
| README.md | ||
workout_app
A new Flutter project.
Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.