← All posts

3 min read

A 319 hour ride and other things inside FIT files

Coaches asked to upload more than a Garmin export: Strava, TrainingPeaks workout files, any zip of FIT files. I wrote that path against synthetic FIT files and the tests passed. Then I fed it one real zip.

319 hsession timer of one ride
2045year a ride landed in
10gym sessions dropped as copies of rides
×4.19Garmin's "calories"

The zip had 462 files from one year, recorded on Garmin, Wahoo and MyWhoosh. These are the things the synthetic files never did.

A session timer of 319 hours

One Garmin file said its session lasted 319 hours. The records inside covered 5.8. CadensIQ finds duplicate recordings by overlap in time, and a ride that lasts 319 hours overlaps everything. It marked 13 real rides as copies of that one and dropped them.

When the timer is far past the records, the records win now, and the ingest notes fit_timer_implausible.

A ride in 2045

MyWhoosh writes a local time that is decades off, and one ride landed in 2045. No real time zone is more than 14 hours from UTC, so any offset beyond that is ignored. The coach's time zone is used instead and the ingest logs it.

Gym sessions inside a paused ride

Bike to the gym, pause the head unit, lift, bike home. The ride's elapsed time covers the strength session a Wahoo recorded in the middle. My duplicate rule saw a recording inside a bigger one and dropped it. Ten strength sessions went that way.

Duplicates are only looked for within a sport group now. A weights session cannot be a copy of a ride.

Calories that are kilojoules

This one came from comparing two exports of the same athlete. The calories in Garmin's export is 4.19 times the kilocalories in the FIT file, on all 139 sessions that had both. It is kilojoules under the wrong name. The index keeps the number as it is, and the tool descriptions now say kJ, not kcal.

What you get from a FIT-only zip

Sessions, power and heart rate curves, load. Not wellness, sleep, VO2max, training status or records, since those live in the Garmin export and not in the ride files.

I ran the real zip through the upload code in Node and the server's own parser: 54 batches, the largest 2.08 MB gzipped, 451 counted sessions. I did not upload it to the hosted app.