Watch-app records a Hike session and my Hike activity's unrelated CIQ datafield is also running?!

I have the built-in Hike activity set up on my fr965 including a CIQ datafield that records a few fit fields.

At the moment I am building an watch-app that happens to record a session with :sport => Activity.SPORT_HIKING. I ran my app and recorded a few seconds of session and synced it to Garmin Connect, and I look at it, and in Garmin Connect (phone app) in the first screen of the activity at the bottom under the CONNECT IQ section what do I see? Not only my watch-app, but also the other CIQ datafield that is installed on my watch and is added to the Hike activity's layout.

I mean it's a surprise.

This is an interesting "feature". I can see it's use cases, though it's hard to believe that a user knows about this and even if they do, not sure they want it. I mean just think about all these reports about apps draining the battery: 

https://forums.garmin.com/developer/connect-iq/f/discussion/872/battery-drain-when-connectiq-app-is-not-running

https://forums.garmin.com/developer/connect-iq/f/discussion/362739/increased-battery-consumption-with-positioning-enabled-in-manifest

So basically a badly written CIQ datafield that does lots of things in compute (let's say more than it should, it computes all kinds of values that is only used by onUpdate) can cause an app to look like it drains battery like ***. And the user has no way to see it on the watch during the usage of the app, only if they look at Garmin Connect after they finished...

I wonder what this means in terms of permissions. I did install the CIQ datafield, and consented to the permissions, and I did add it to the Hike activity, so I know it's using those permissions when I start THE Hike activity, but now a different app also causes those things to be enabled without me knowing...

  • Clearly it's a bug. I've seen it reported in device forums (like Fenix 7) in at least 2 forms:

    - as you described it: the user runs a CIQ device app and a CIQ data field is also active

    - the user runs a native activity and a CIQ data field (e.g. Stryd Zones) from a different activity is active

    In both cases, the CIQ data field is not visible on the screen (obviously), but they can tell because the CIQ data field records developer FIT fields to the activity file.

    I think  might have seen this behavior.

  • hum no, i can't remember reading this type of feedback before.

    I will track it and comeback here if i find more information.

  • I tested this with 's Hike2+ ( https://apps.garmin.com/apps/116a5b59-29ae-4397-a70e-907d7e5f8e44 ) and it doesn't reproduce the bug, so I'm starting to think that maybe this only happens if the DF and the App belongs to the same developer? That would be super strange. Or maybe it depends on the way you record the session in the app? jim_m_58, how do you record the session in Hike2+?

    function onShow() {
        session = ActivityRecording.createSession({
        	:name => "Hike",
        	:sport => Activity.SPORT_HIKING
        });
        
        session.createField();
        session.start();
    }
    
    function onHide() {
      session.stop();
      session.save();
    }
    

    Are you doing something different? Because I don't even see Hike2+ listed as an CIQ app there (I guess this is because it doesn't add additional fields to the fit?) nor my datafield from the Hike activity.

  • Noting magic or special.  Back when I wrote Crumbs (the pre-cursor of Hike1 which was the pre-cursor of Hike2) in 2015, I based it on the RecordSample at that time, and I don't think the RecordSample has really changed since then.

    I have DFs I wrote on the same devices where I have Hike2 and no issues.

    I don't use onShow/onHide to start/stop the session.  I do that based on an input delegate - press start to begin the recording, press start again, you get a menu to resume/save/discard.  I can see the way you do it could be an issue.  With the recordSample, onMenu is used to start/save

  • I don't really do it onShow, it was just to show the relevant code (what I do with session). I also use an InputDelegate. I don't think that that (or any "stupid" thing a developer might be able to do) could cause the system to include the Hike activity's datafields. But for some reason when I use Hike2+ it doesn't include, even though it does record it as Hike type (my app also does the exact same setting to choose between Walk and Hike)

    So maybe it really has to do something with the 2 apps (watch-app and datafield) belonging to the same developer. Plus I do record custom fit fields in both. I think that also might play a role, as I didn't see Hike2+ being listed as a CONNECT IQ app in the recorded activity, so either it should've and then it's another bug, or it only should list there CIQ apps that contribute to the fit file, but doesn't include data fields that only display things.

  • There is a setting in GC to use the generic name or the name from the device.

    So I see

    There are no FitContrib fields in the app, I tend to only use them in data fields..

  • Plus I do record custom fit fields in both. I think that also might play a role, as I didn't see Hike2+ being listed as a CONNECT IQ app in the recorded activity, so either it should've and then it's another bug, or it only should list there CIQ apps that contribute to the fit file, but doesn't include data fields that only display things.
    There is a setting in GC to use the generic name or the name from the device.

    I think the point is about the section of the Connect activity page which displays 3rd party app(s) (with links to the store) that were used during the activity (and under what circumstances those apps will actually be displayed), not whether the user is able to have the app/device activity name show up in the Connect activity name by changing a setting.

    To me it is indeed interesting to note that a CIQ data field which records custom FIT fields to an activity will be listed in the activity this way, but a CIQ device app which records an activity (but no custom fields) will not. It feels like an oversight (or bad design to me). As a user, I would expect any CIQ device app that records an activity to be listed, not just device apps which also record developer fields.

    But the reality is that only apps which record custom fields are listed in this way (regardless of whether the app type is device app or data field). [I did notice this behavior years ago, and I'm fairly sure it's always been this way]

    I did notice that if you use fitfileviewer.com to look at FIT files where CIQ apps were involved, the "Developer Data Id" section (containing the CIQ application store ID and version) is only available if custom fields were written. It is not available when a device app recorded an activity with no custom field - on such an activity, there is no reference to the CIQ app at all, except that the app name is populated in the name field of the Sport section (which is ofc also used for the native activity name, which means that there's no way to use this field to definitively tell whether the app was recorded by a built-in activity/app or a 3rd party app). And even if you could guess that the activity was recorded by a 3rd party app (due to having a name that doesn't match any native activities), you'd only have the app name, and not the unique store ID (or app version)

    So it seems that the problem isn't really on the Connect side, but it's a consequence of how activities are recorded.

    TL;DR Connect IQ app info (i.e. the store ID and app version) is only present in the FIT file when custom fields are recorded.

    It isn't possible for Connect to display said app info unless it's present in the FIT file, obviously, which is why CIQ device apps which simply record an activity - with no custom fields - aren't listed in the Connect activity page. I think this is either a design flaw or implementation issue, but clearly the fix is more involved if it's on the device side, and I don't expect this to ever change tbh.