Description
In Workout.onStart(Scope s, Workout w), the method ignores the provided s parameter and unconditionally triggers all scopes (ACTIVITY, STEP, and LAP).
This causes duplicate lifecycle and feedback events during workout initialization.
File / Code
File: app/src/main/org/runnerup/workout/Workout.java
if (currentStep != null) {
currentStep.onStart(Scope.ACTIVITY, this);
currentStep.onStart(Scope.STEP, this);
currentStep.onStart(Scope.LAP, this);
}
Steps to Reproduce
- Start a workout with a specific scope (e.g.,
Scope.ACTIVITY).
- Observe that the method fires all three scopes instead of the provided one.
Expected Behavior
onStart should only trigger the scope provided as an argument.
Actual Behavior
All three scopes are called, producing duplicate feedback and events.
Impact
Duplicate lifecycle calls and inconsistent behavior in step tracking and feedback systems.
Proposed Fix
Replace the three hard-coded calls with one that honors the argument:
if (currentStep != null) {
currentStep.onStart(s, this);
}