mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
The workout batch kept `route` only for entries it inserted. An entry matching a stored workout reported `duplicate` and its track was dropped, so turning on `storeWorkoutRoutes` only helped workouts recorded from then on. A matching entry that carries a route now attaches it when the stored workout has no track and the account keeps tracks, the same way the heart-rate series enrichment works: the planner probes for a stored track, the write seals it like an insert does, and the entry reports `enriched` (once, also when it attaches series and track together). The climb derived from the track fills an empty `elevationM`, as it would on insert. A workout that already has a track keeps it, and with routes off nothing is written. Track rows now go through `createManyAndReturn` on the unique `workoutId`, so a track that lands between the probe and the write wins and this entry settles as a duplicate instead of failing or adding a second row.