Skip to content

Fix: Workout Checkin Logging - #117

Open
melissavelasquezz wants to merge 3 commits into
mainfrom
melissa/workoutcheckin
Open

melissavelasquezz wants to merge 3 commits into
mainfrom
melissa/workoutcheckin

Conversation

@melissavelasquezz

Copy link
Copy Markdown
Contributor

Overview

Fixes the check-in flow reporting success even when the workout wasn't actually saved, and makes sure it is now properly logged in the backend and persists to workout history.

Changes Made

First bug: False success
CheckInViewModel.onCheckIn() marked the check-in complete (confetti, Complete UI state) before the logWorkout mutation even ran, so failures were invisible to the user and never surfaced in history.

  • Reordered so the mutation runs first and only successful responses transition to Complete. A failure now transitions to a new Failed state instead.
  • Added CheckInFailed composable with Retry/Close actions, wired into CheckInPopUp.

Second Bug: wrong ID was being sent to the backend
The check-in flow was passing the gymId instead of facilityId into the logWorkout mutation, so every call failed.

  • Fixed in CheckInViewModel.kt.

Added WorkoutLogRepository, a small event bus — CheckInViewModel notifies it on success, and ProfileViewModel now subscribes and reloads, so workout history/streaks reflects the new workout

Test Coverage

Tested on emulator

@melissavelasquezz melissavelasquezz changed the title Melissa/workoutcheckin Fix: Workout Checkin Logging Sep 17, 2026
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 0b1b92ba-dd84-410c-b29a-9098f9bfe11d


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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