Skip to content

Fix exercise progress entry overwrite and enhance analytics dashboard#74

Merged
JSR-Mario merged 12 commits into
mainfrom
develop
Jul 7, 2026
Merged

Fix exercise progress entry overwrite and enhance analytics dashboard#74
JSR-Mario merged 12 commits into
mainfrom
develop

Conversation

@JSR-Mario

Copy link
Copy Markdown
Owner

No description provided.

JSR-Mario and others added 12 commits July 6, 2026 22:01
…rite

Three bugs fixed in analytics-service:

1. ExerciseProgressEntry unique constraint was (user_id, exercise_id,
   session_date). Completing the same exercise in two sessions on the
   same calendar date caused the second entry to silently overwrite
   the first, dropping the accumulated volume in the chart.
   New constraint: (user_id, exercise_id, session_id).

2. processSessionUncompleted looked up entries by (exerciseId, sessionDate)
   which could match the wrong entry or find nothing. Replaced with a
   single bulk deleteByUserIdAndSessionId call — precise and efficient.

3. processSessionCompleted now upserts correctly on re-complete because
   the lookup key includes sessionId, so the existing entry is found
   and overwritten in place rather than creating a duplicate.

Migration V4 adds session_id column and replaces the old unique constraint.
Legacy rows with session_id = NULL are retained (NULL is not equal in
PostgreSQL, so no constraint violations).
…eral

Fix/duplicate volume non unilateral
Redesign analytics dashboard and enhance exercise search UI
@JSR-Mario JSR-Mario merged commit 0414dee into main Jul 7, 2026
5 checks passed
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