extra SESSION message when recording .FIT file - FR630

Using the RecordSample sample from the SDK, as well as my own app, I often get a .FIT file with an extra SESSION record right at the beginning along with a single LAP and DATA message just before it. This happens both in the simulator and the actual watch. But not always. It's fairly easy to filter out since it has an elapsed time of zero but when I load the file into Strava, it actually thinks I'm uploading two activities.

This is using the latest SDK and specifying ver 1.3.

Has anybody seen this and have any suggestions on how to fix it. I know it's not common as I have my own .FIT parser that had a bug with an zero duration Session and I've never hit it before.
  • Turns out this was user error. I was inadvertently taking a path app.onStop() that was causing a new activity to be started. So basically I was leaving an open session on exit. Interesting that CIQ would let the session stay open and be part of the next activity from a completely different app. I'd say that is also a bug. But the root cause was a bug in my code.
  • Thanks for doing a little more work on it over the weekend. I was trying to reproduce this last week and having issues. I'd love to see the bit of "app.onStop()" code that was causing the open session. You could PM me or email at [email][email protected][/email] and we would be happy to take a look and see if there is a bug that we need to address. Many thanks!

    -Coleman
  • Thanks for doing a little more work on it over the weekend. I was trying to reproduce this last week and having issues. I'd love to see the bit of "app.onStop()" code that was causing the open session. You could PM me or email at [email][email protected][/email] and we would be happy to take a look and see if there is a bug that we need to address. Many thanks!

    -Coleman


    I had pulled the code out of hte RecordSample for starting and stopping the session into a function called startStopSession. I erroneously was calling that from the App.onStop() function. So where as the sample code forces a stopSession, my code would stop the session if it was started, but also start it if it was stopped.

    So effectively in the App.onStop() method, I was calling

    session=createSession();
    session.start();

    This leaves an open session for whatever app starts next. Not sure if the system should protect against this or not (bug vs by design).