bikehopper / bikehopper-ui

Friendly bike+transit directions (frontend)
Other
26 stars 1 forks source link

Type FIT generation code #373

Closed graue closed 2 months ago

graue commented 3 months ago

It looks like there was a bug where all the timestamps were getting written as NaN, due to no startDate being passed into createRecordMessages. Can you make sure fixing this doesn't introduce new problems?

vincepmartin commented 3 months ago

It looks like there was a bug where all the timestamps were getting written as NaN, due to no startDate being passed into createRecordMessages. Can you make sure fixing this doesn't introduce new problems?

This seems to cause an issue where the entire route does not get connected. I swear this worked prior to my last refactor with the time stamps, and your fix should be doing basically the same thing my code used to do. Interesting that with them set as NaN it works.

But anyway, I was out of town for a week or so for business, I Just got back yesterday, so I should be able to find some time to sit down and debug/fix this by the weekend.

graue commented 3 months ago

Okay, no rush at all. That's mysterious!

It's possible I made some other error while adding types that caused the problem, unrelated to timestamps...?

vincepmartin commented 2 months ago

I think I fixed this. It was a bit tricky to track down. But apparently iterating our timestamps by only 10 was causing some confusion when trying to link course point messages to the records. At least that is my theory. But I found that increasing this value to 1000 will allow this to work properly. I have tested this out on a few applications and it seems to solve the problem of having a malformed map.

Here is the fit file loaded on the Garmin app on iphone. image

And here it is on the actual garmin computer! image

However, I have to run to Scenic Routes in a little bit, and am going to used a generated FIT file IRL to do that. So once I verify that works, we should be good to go with this feature again.

Thanks @graue for porting this to TS and pointing out this bug, appreciate it!

graue commented 2 months ago

Cool, let me know how it works!

vincepmartin commented 2 months ago

Cool, let me know how it works!

Tested it out by going to Beach'n from my house. Worked!