Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: message arrival ordering and values accumulation #120

Conversation

muktihari
Copy link
Member

This PR consist of 3 bugs that was missed to address from the previous release. This PR should conclude all the missed issues (fixes are separated in different commit for easier review).

  1. This was one of the main issue when I was proposing tools: make combine logic align with FIT Activity CLI #114 (other than the maintaining two separate code issue). It is to preserve the original messages arrival order when we decoding then encoding the FIT again.

    Previously, all the messages that have no timestamp will be placed at the beginning, this was obviously an issue as some of them may need to be retrieved by arrival order. When I think about it again, actually we can track the messages ordering by injecting the previous timestamp into the message that has no timestamp field, then we can sort it again by the timestamp, now we get the ordering as close as the original order, even though it's not exactly the same, at least they done not overlap 👍 . The additional timestamp then is being removed before encoding.

  2. In record messages, there are two fields that need to be accumulated when combine, first is distance, we have done it but it turns out still not correct, the other that we missed to accumulate is accumulated_power.

    • Distance incorrectness: previously, we only accumulate the combined session's record which have the same sport and only append as it is when sport is not the same (distance start at zero), when I take a look at this triathlon activity file which consist of swimming, cycling and running. every sport start from previous distance so if swimming end in 4km, cycling distance start at 4km, and so on. In previous logic, each sport session start at zero distance which is not correct. This has been resolve now.

    • Accumulated power: accumulation logic for this value is the same as distance, and it's have been implemented.

  3. Fix minor UI: Sport Name was missing from Lap section.

@muktihari muktihari added the bug Something isn't working label Sep 25, 2024
@muktihari muktihari self-assigned this Sep 25, 2024
@muktihari muktihari marked this pull request as draft September 25, 2024 14:48
@muktihari muktihari marked this pull request as ready for review September 25, 2024 15:04
Copy link
Member

@raditzlawliet raditzlawliet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it

@raditzlawliet raditzlawliet merged commit 34e76e9 into openivity:dev Sep 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants