sports-alliance / sports-lib

A Library for processing GPX, TCX, FIT and JSON files from services such as Strava, Movescount, Garmin, Polar etc
GNU Affero General Public License v3.0
149 stars 21 forks source link

Fix regression introduced in PR #48 when a fit file has multiple activities #49

Closed thomaschampagne closed 4 years ago

thomaschampagne commented 4 years ago

I unfortunatly introduced a bug on PR #48 with start and end dates of session/activities.

I seen this error when parsing a triathlon fit file (Kona Ironman world championship 2018) of one of my users.

I fixed the regression and added a new test case in integration tests (fit file coming from a triathlon event).

When importing the fit file in strava, it gives:

codecov-io commented 4 years ago

Codecov Report

Merging #49 into develop will increase coverage by 3.69%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop      #49      +/-   ##
===========================================
+ Coverage    72.72%   76.42%   +3.69%     
===========================================
  Files          175      175              
  Lines         4367     4373       +6     
  Branches       650      653       +3     
===========================================
+ Hits          3176     3342     +166     
+ Misses        1177     1018     -159     
+ Partials        14       13       -1
Impacted Files Coverage Δ
src/events/adapters/importers/fit/importer.fit.ts 83.78% <100%> (+6.19%) :arrow_up:
...ents/adapters/importers/fit/importer.fit.mapper.ts 100% <0%> (+3.27%) :arrow_up:
src/streams/stream.ts 94.44% <0%> (+5.55%) :arrow_up:
src/data/data.position.ts 85.71% <0%> (+7.14%) :arrow_up:
src/streams/ibi-stream.ts 26.08% <0%> (+13.04%) :arrow_up:
src/events/utilities/event.utilities.ts 85.09% <0%> (+18.8%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5e5c8fd...fff20d2. Read the comment docs.