screen-locker/stronglift_replacement/workout_app/lib/services
Krzysztof kuhy Rudnicki ac7a7afa08 Extract WorkoutSyncSession from workout_sync_service.dart (322 -> 218)
The one file on the list that could not be fixed by moving code, so the
approach was agreed with the user first: extract a real collaborator rather
than change the public surface.

`push`, `pushManual` and `syncNow` were three near-identical bodies — same
configured-or-bail guard, same GitHubClient/Firebase/MirrorStore construction,
same getFileText/mergeLogs/syncLog round-trip, same catch-everything-and-report
handler, same close-both finally. They differed in the record they merged in
(one, one, none) and two strings. That shared body is now
WorkoutSyncSession.run(), and the three methods are thin wrappers holding only
their own guard and their own wording.

Why a collaborator and not a `part` extension: extension methods dispatch
statically. Four fakes in _home_test_fixtures.dart override `syncNow`, and
manual_workout_screen_test.dart overrides `pushManual` and
`readMergedManualPayloads` — with those in an extension the real
implementations would run while the fakes sat unused, which is how four tests
hung on pumpAndSettle in an earlier attempt. All four remain ordinary methods
on WorkoutSyncService, so every override still binds.

`successReason` and `failurePrefix` are passed in rather than derived from one
another, so the exact strings the tests assert on ('pushed' / 'push failed',
'synced' / 'sync failed') stay under the callers' control.

Unlike the part files, this is a real library with its own lcov SF: entry, so
it has to carry its own coverage — it does. The total drops 2751 -> 2728
covered lines, which is the duplication the extraction removed.

402 tests pass; dart analyze clean; coverage 100%.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EveB813BQ8abAP68VSqZ5Y
2026-08-15 22:28:02 +02:00
..
backup_service_session.dart Split backup_service.dart; partly split workout_sync_service.dart 2026-08-15 21:38:42 +02:00
backup_service.dart Split backup_service.dart; partly split workout_sync_service.dart 2026-08-15 21:38:42 +02:00
firebase_backend.dart workout_app: add Google sign-in support for the Firebase sync account 2026-08-14 10:56:16 +02:00
github_device_auth.dart Carry progression through Firebase, and stop demanding storage permission 2026-08-10 16:54:21 +02:00
google_platform_io.dart workout_app: add Google sign-in support for the Firebase sync account 2026-08-14 10:56:16 +02:00
google_platform_web.dart workout_app: add Google sign-in support for the Firebase sync account 2026-08-14 10:56:16 +02:00
google_platform.dart workout_app: add Google sign-in support for the Firebase sync account 2026-08-14 10:56:16 +02:00
google_sign_in_backend.dart workout_app: add Google sign-in support for the Firebase sync account 2026-08-14 10:56:16 +02:00
http_server_service.dart Carry progression through Firebase, and stop demanding storage permission 2026-08-10 16:54:21 +02:00
progression_sync_service_pull.dart Split progression_sync_service.dart (433) into four 2026-08-15 21:44:43 +02:00
progression_sync_service_push.dart Split progression_sync_service.dart (433) into four 2026-08-15 21:44:43 +02:00
progression_sync_service_session.dart Split progression_sync_service.dart (433) into four 2026-08-15 21:44:43 +02:00
progression_sync_service.dart Split progression_sync_service.dart (433) into four 2026-08-15 21:44:43 +02:00
storage_service_backup.dart Split storage_service.dart (781) into part extensions 2026-08-15 21:12:08 +02:00
storage_service_exercises.dart Split storage_service.dart (781) into part extensions 2026-08-15 21:12:08 +02:00
storage_service_schema.dart Split storage_service.dart (781) into part extensions 2026-08-15 21:12:08 +02:00
storage_service_sessions.dart Split storage_service.dart (781) into part extensions 2026-08-15 21:12:08 +02:00
storage_service.dart Split storage_service.dart (781) into part extensions 2026-08-15 21:12:08 +02:00
sync_device_id.dart Push under a persisted per-install uuid, not a fixed role id 2026-08-09 17:31:15 +02:00
sync_service.dart Carry progression through Firebase, and stop demanding storage permission 2026-08-10 16:54:21 +02:00
sync_settings.dart Carry progression through Firebase, and stop demanding storage permission 2026-08-10 16:54:21 +02:00
sync_state_factory.dart Sync workouts through Firebase, mirroring to GitHub during the cutover 2026-08-05 08:12:40 +02:00
sync_status.dart Add sync-status card and duration-threshold fixture 2026-08-15 18:41:31 +02:00
workout_sync_service_read.dart Split backup_service.dart; partly split workout_sync_service.dart 2026-08-15 21:38:42 +02:00
workout_sync_service.dart Extract WorkoutSyncSession from workout_sync_service.dart (322 -> 218) 2026-08-15 22:28:02 +02:00
workout_sync_session.dart Extract WorkoutSyncSession from workout_sync_service.dart (322 -> 218) 2026-08-15 22:28:02 +02:00