Hi everyone,
I’ve noticed a small issue in the sync logic between TrainingPeaks and Intervals (via Tp2Intervals).
Currently, it seems the code compares the total duration of the workouts to avoid duplicates, but it’s not handling seconds correctly. For example:
- TrainingPeaks Workout: PT1H59M10S (Total: 01:59:10)
- Intervals.icu: Displays/stores as 01:59 (ignoring or stripping seconds).
Because of this, the comparison logic fails. Since 01:59:10 != 01:59:00, the tool identifies it as a new workout and creates a duplicate record every time the sync runs.
Technical Suggestion: In the class WorkoutDetails, specifically inside the equals method, we should truncate the duration to minutes before performing the comparison to ensure consistency. If the java.time.Duration object is being used, the fix would look like this:
if (duration?.truncatedTo(ChronoUnit.MINUTES) != other.duration?.truncatedTo(ChronoUnit.MINUTES)) return false
This ensures that a small difference in seconds (like the 10s in my example) doesn’t trigger a new sync and cause duplication.
Has anyone else experienced this?
Best regards.

