Skip to content

fix(workout-session): mark all sets completed when finishing a session - #218

Open
evan188199-tech wants to merge 1 commit into
Snouzy:mainfrom
evan188199-tech:fix/finish-session-marks-sets-completed
Open

fix(workout-session): mark all sets completed when finishing a session#218
evan188199-tech wants to merge 1 commit into
Snouzy:mainfrom
evan188199-tech:fix/finish-session-marks-sets-completed

Conversation

@evan188199-tech

Copy link
Copy Markdown

What

When a user finishes a workout via Finish Session (the overall session-end button) without first clicking Finish Set on every set, the session is marked status: \"completed\" with endedAt set, but the individual sets keep completed: false.

Why

completeWorkout() updated only session-level fields and never touched the per-set completed flag. Analytics that filter on set.completed therefore miss these sessions entirely:

  • Volume calculations (weightKg × reps over completed: true sets) report zero
  • ACWR fatigue curves show a false dip
  • Exercise completion stats undercount

Changes

In completeWorkout(), mark every set in the session as completed: true and persist the updated exercises alongside the session status/endedAt. Also removed a leftover debug console.log in the same function.

Fixes #212.

`completeWorkout()` only updated session-level fields (`status`,
`endedAt`) and never touched the per-set `completed` flag. Sessions
wrapped up via "Finish Session" instead of finishing each set therefore
kept `set.completed = false`, making them invisible to analytics that
filter on `set.completed` (volume, ACWR fatigue, completion stats).

Mark every set in the session as `completed: true` and persist the
updated exercises alongside the session status. Also drop a leftover
debug `console.log` in the same function.

Fixes Snouzy#212
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Workoutcool Team Team on Vercel.

A member of the Team first needs to authorize it.

@evan188199-tech

Copy link
Copy Markdown
Author

此 PR 由 GLM-5.2 修复。

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.

Bug: "Finish Session" does not mark sets as completed — analytics miss the workout

1 participant