Skip to content

Apple Watch: a timed hold that ends on the phone first is logged twice #1409

Open

Description

@cubetes

Suggested labels: bug, mobile

With "Timed holds start by themselves" on, the iPhone and the Apple Watch both run a timed hold. If the phone's hold ends first, the watch's hold still runs. When it ends, it logs a set nobody did, and its rest replaces the phone's rest.

Why a lifter cares: a plank workout ends with an extra set in the log and the wrong rest on the wrist, and the lifter has to fix both by hand.

What happens

  1. Turn on "Timed holds start by themselves" on the phone. Start a workout with a timed exercise.
  2. Phone and watch both count in and run the hold of set 1. The phone's ends first and logs set 1.
  3. The phone's snapshot reaches the watch. The watch's hold keeps running, because a running hold does not follow the phone.
  4. The watch's hold ends. completeSet takes the set up next at that moment, which is now set 2, and logs it with the hold's seconds.

Result: set 2 is logged and nobody held it. Its rest also replaces the one the phone started for set 1.

Where: SessionStore.endHold calls completeSet(sec:), which uses setIndex, the first set not done. Nothing ties the hold to the set it started on.

Found while fixing #1403 (the same bug on Garmin, fixed in #1404). Wear OS looks the same: WearStore.endHold also logs setIndex() at the end. Its guard from 3862a4e only keeps the phone's tick from moving the page during the hold, it does not end the hold. I did not touch Wear here.

Related: #1403, #1404, 3862a4e. Checked: no open or closed issue and no open PR covers this (#1139 and #1185 touch SessionStore but not the hold path).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions