Harden workout start and save (Astra review) #15

Merged
berkay merged 1 commit from astra-review-fixes into main 2026-11-10 13:54:49 +03:00
Owner

Requested by Berkay · project thread

Fixes from Astra's review of 9a7bb92, checked against current main.

What

  • Double START (high): SessionController.start now has a single-start lock and returns false for a second call while the first is still preparing audio/the foreground service. Home, workout detail and setup only open the session screen when the start actually happened.
  • Discipline check on every start path (high): the engine now filters drill plans by Combo.fits like it already did for the random pool, so a kick added later to a combo in a Boxing workout is skipped no matter where the workout was started. Starting from home/detail shows a snackbar with how many combos were skipped. (Setup still blocks start and offers to remove them.)
  • "Saved to your history" before the save finished (medium): SessionView.saveStatus (saving / saved / failed). Summary shows "Saving…", then "Saved to your history", or an error with TRY AGAIN (retrySave). Rating saves go through the same path.
  • PREV vs automatic timing (medium): already fixed in #14 (drill PREV/NEXT move the clock).

Not changed: release signing still uses the debug key (needs a keystore decision from Berkay).

Tests

flutter analyze clean, flutter test 83 passing (4 new: double start, drill discipline filter, save success, save failure).

No APK built, no version bump.

🤖 Generated with Claude Code

https://claude.ai/code/session_015s4aKn6Q7AftVbZ2Mi5d1v

<!-- claude-projects-attribution --> _Requested by **Berkay** · [project thread](https://claude.ai/code/project/chan_01T5Cs4GeJAnhjXKSJKvCDa2?thread=cmsg_01T5Cs4GeJAnhjXKSJKvCDa27aDoFiirb6FRcT1pYH9rw7)_ Fixes from Astra's review of `9a7bb92`, checked against current `main`. ## What - **Double START (high):** `SessionController.start` now has a single-start lock and returns `false` for a second call while the first is still preparing audio/the foreground service. Home, workout detail and setup only open the session screen when the start actually happened. - **Discipline check on every start path (high):** the engine now filters drill plans by `Combo.fits` like it already did for the random pool, so a kick added later to a combo in a Boxing workout is skipped no matter where the workout was started. Starting from home/detail shows a snackbar with how many combos were skipped. (Setup still blocks start and offers to remove them.) - **"Saved to your history" before the save finished (medium):** `SessionView.saveStatus` (saving / saved / failed). Summary shows "Saving…", then "Saved to your history", or an error with TRY AGAIN (`retrySave`). Rating saves go through the same path. - **PREV vs automatic timing (medium):** already fixed in #14 (drill PREV/NEXT move the clock). Not changed: release signing still uses the debug key (needs a keystore decision from Berkay). ## Tests `flutter analyze` clean, `flutter test` 83 passing (4 new: double start, drill discipline filter, save success, save failure). No APK built, no version bump. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015s4aKn6Q7AftVbZ2Mi5d1v
- One start at a time: a second START tap while audio and the service
  get ready is ignored, so there is one timer and one session screen.
- Discipline rule enforced in the engine for drill plans too (random pool
  already did), so every start path skips combos that don't fit; starting
  from home/detail says how many were skipped.
- Summary shows "Saving…", "Saved to your history" or a save error with
  TRY AGAIN, instead of claiming success before the write finished.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015s4aKn6Q7AftVbZ2Mi5d1v
berkay merged commit 9043c300b1 into main 2026-11-10 13:54:49 +03:00
berkay deleted branch astra-review-fixes 2026-11-10 13:54:49 +03:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
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
berkay/bagdrill!15
No description provided.