Skip to content

Align Watch EMOM reps with iPhone (1-based currentInterval) - #59

Merged
wuersch merged 1 commit into
mainfrom
fix/emom-watch-reps-off-by-one
Jun 18, 2026
Merged

Align Watch EMOM reps with iPhone (1-based currentInterval)#59
wuersch merged 1 commit into
mainfrom
fix/emom-watch-reps-off-by-one

Conversation

@wuersch

@wuersch wuersch commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Problem

For an EMOM workout, the Watch's REPS metric read one behind the iPhone for the entire workout — 0/N at the start while the iPhone showed 1/N.

This was not a connectivity/sync bug. Both devices run the same shared EMOMTimerModel and compute the rep count independently from the same time anchor (EMOM sends no rep-count messages — unlike AMRAP's .incrementRound). The gap was a pure display offset: the two views rendered different properties of the same model.

  • iPhoneEMOMTimerView.swift:127/:435 render currentInterval = min(completedIntervals + 1, totalIntervals) (1-based, "interval currently in progress").
  • WatchWatchEMOMTimerView.swift:226 rendered completedIntervals (0-based, "reps finished").

Change

Render currentInterval on the Watch so it matches the iPhone's 1-based display:

- value: "\(timerModel.completedIntervals)/\(timerModel.totalIntervals)",
+ value: "\(timerModel.currentInterval)/\(timerModel.totalIntervals)",

currentInterval (EMOMTimerModel.swift:68) already caps at totalIntervals, so completion still reads N/N (no over-count). No model change — it's the existing, tested source of truth (EMOMTimerModelTests.currentInterval_startsAtOne). The iPhone already uses currentInterval across all its REPS surfaces, so the Watch was the lone outlier.

Also bumps MARKETING_VERSION to 1.5.3 on the iOS and Watch app targets (coordinated release).

Verification

  • xcodebuild build succeeds (iOS app + embedded Watch app).
  • Manual (Xcode): start an EMOM workout from the iPhone; the Watch REPS row now reads 1/N at the start and advances in lockstep with the iPhone, ending N/N.

🤖 Generated with Claude Code

The Watch "REPS" metric showed `completedIntervals` (0-based) while the
iPhone shows `currentInterval` (1-based, the interval currently in
progress). Both views read the same shared EMOMTimerModel, computed
independently from the same time anchor — so the gap was purely a display
offset: the Watch read one behind the iPhone for the whole workout (0/N at
start vs 1/N).

Render `currentInterval` on the Watch so both devices match in lockstep
(1/N → N/N; the model already caps at totalIntervals, so no over-count).

Also bump MARKETING_VERSION to 1.5.3 on the iOS and Watch app targets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wuersch
wuersch merged commit 56f9131 into main Jun 18, 2026
2 checks passed
@wuersch
wuersch deleted the fix/emom-watch-reps-off-by-one branch June 18, 2026 21:27
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