muktihari / fit

A FIT SDK for decoding and encoding Garmin FIT files in Go supporting FIT Protocol V2.
BSD 3-Clause "New" or "Revised" License
42 stars 4 forks source link

fix: encoder dynamic protocol version validator #417

Closed muktihari closed 2 months ago

muktihari commented 2 months ago

After allowing dynamic protocol version, we didn't set the validator to validate based on the current protocol version that being used. When users use default protocol version 1 but the messages contains developer data or basetype that is not supported by version 1, the resulting file will not be correct even if maybe it can still be decoded. This PR fix that bug.

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (0616e92) to head (7fc102c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #417 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 41 41 Lines 3695 3695 ========================================= Hits 3695 3695 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.