Skip to content

Fix the dashboard sleep race and eight bugs from the develop review - #24

Closed
sayed0am wants to merge 1 commit into
developfrom
pr21-fixes
Closed

sayed0am wants to merge 1 commit into
developfrom
pr21-fixes

Conversation

@sayed0am

@sayed0am sayed0am commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Fixes for #21 (develop into main), from a review of the whole develop diff.

CI failure

DeletedNightStateTest failed on CI. DayViewModel read sleep through two separate Room flows, one for the night and one for the strip of nights. After a delete or a restore they could update one after the other, and the test caught the state in between. Now one read feeds both, so they always change together.

Bugs

  • Mind and body: a paused quiet screen showed a Pause button that did nothing. It now shows Resume.
  • Backup: badges, past weeks, saved workouts, exercises and workout rounds weren't backed up. They are now restored whole. An exercise already on the phone keeps its own last weight, and restoring twice adds nothing.
  • Personal bests: a lift typed in another case ("bench press" against "Bench press") wasn't reported as a new best.
  • Game summary: periods were named from how many were played. A quarters game ended after two read "1st half, 2nd half". They're now named from the game's setup, in the live screen's wording.
  • Sleep edits: an edit was resolved against the one session alone, so editing or deleting a nap could overwrite the edit of a nap next to it. It's now resolved among nearby sessions, as the screens do.
  • Sleep times sheet: the overlap check only saw the day's naps. It now checks every sleep around the day, including last evening's nap.
  • Zone ranges: they now read again after the zones are moved on the Heart rate zones page.
  • Start on your usual: it could start a kcal goal that Ready no longer offers.

Not in this PR

  • Folded phone (split view): HIIT and run reps get no Skip or +10 s, and games get no Half time. Fixing this changes the folded layout, so it needs a look on the Fold first.
  • Weekly recap: rewards only refresh while the app is open, so the recap can send stale numbers. The fix moves the rewards refresh out of MainActivity, which is a bigger change.

Testing

  • ./gradlew :protocol:test :app:testDebugUnitTest in UTC: 1182 tests, 0 failed, 1 skipped.
  • assembleDebug and assembleRelease both build.
  • New tests cover the backup tables, the lift case, early-ended games, the neighbouring nap edit and the kcal goal.
  • Not tried on the phone yet.

🤖 Generated with Claude Code

- One sleep read for the night and the strip of nights, so a delete or a
  restore changes both in the same state (DeletedNightStateTest on CI)
- Mind and body: a paused quiet screen shows Resume, not a dead Pause
- Backup: badges, past weeks, saved workouts, exercises and rounds
- Personal bests: a lift typed in another case still beats its best
- Game summary: periods named from how the game was set up
- Sleep edits: resolved among neighbouring sessions, so editing one nap
  can't overwrite the next one's edit
- Times sheet: checks overlaps against every sleep around the day
- Zone ranges read again after the zones are moved
- Start on your usual: no kcal goal Ready wouldn't offer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sayed0am

sayed0am commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Closing in favour of #25, which contains this branch's commit and the rest of the review fixes.

@sayed0am sayed0am closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant