screen-locker/stronglift_replacement/workout_app
Krzysztof kuhy Rudnicki ffc6c72df0 Push under a persisted per-install uuid, not a fixed role id
screen_locker pushed manual workouts as "pc" and the workout app as "phone".
A role constant collides the moment a second machine takes the same role, and
after a reinstall the new install inherits the previous one's CRDT identity.
Both halves now mint a uuid once and persist it: the PC in
~/.local/share/screen_locker/.device_id, the app under SharedPreferences
'crdt.nodeId' -- the same key every sibling app uses.

The old constant survives as the legacy id and is passed to sync_log /
syncLog, so devices/<legacy>/ is skipped as this device's own rather than
re-downloaded and re-merged as a peer's on every tick. It drops to None once
that path is reclaimed.

Note the *read* loop in _workout_sync deliberately still merges every device
including this one: the PC needs its own manual workouts in the merged view,
so "skip own" would be wrong there. Only the push path and the HLC node id
move.

The test fixture redirecting the new id file is added in the same change that
introduces the constant -- without it the first test that syncs mints a uuid
into the real state dir and this machine's live sync identity is decided by
whichever test ran first. Verified: ~/.local/share/screen_locker/ held no
.device_id after a full suite run.

Verified against the live backend, not just mocks: ran the real
push_pc_workouts, which minted 57582b3b and pushed 9 records. In the RTDB the
new device's log is a strict superset of both old paths -- 0 of devices/pc/'s
10 records and 0 of devices/phone/'s 9 are missing from it.

Python: 907 tests, 100% branch coverage. workout_app: 313 tests, analyzer
clean. Pins bumped to crdt-sync-v0.6.0 / crdt_sync_dart-v0.7.0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GZH89WEqAjuJT8WZdqc7AP
2026-08-09 17:31:15 +02:00
..
android Build and publish a signed APK on every push to main 2026-08-04 20:55:04 +02:00
assets Fix on-fill text contrast on filled buttons, bump gatelock pin 2026-07-21 21:17:14 +02:00
lib Push under a persisted per-install uuid, not a fixed role id 2026-08-09 17:31:15 +02:00
test Push under a persisted per-install uuid, not a fixed role id 2026-08-09 17:31:15 +02:00
.gitignore feat: add Flutter workout app (StrongLifts replacement) 2026-05-31 16:23:46 +02:00
.metadata feat: add Flutter workout app (StrongLifts replacement) 2026-05-31 16:23:46 +02:00
analysis_options.yaml Add comprehensive test suite, backup service, and linting to workout app 2026-06-28 08:11:43 +02:00
CONTEXT.md feat: add Flutter workout app (StrongLifts replacement) 2026-05-31 16:23:46 +02:00
pubspec.lock Push under a persisted per-install uuid, not a fixed role id 2026-08-09 17:31:15 +02:00
pubspec.yaml Push under a persisted per-install uuid, not a fixed role id 2026-08-09 17:31:15 +02:00
README.md feat: add Flutter workout app (StrongLifts replacement) 2026-05-31 16:23:46 +02:00

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.