Under Review
over 1 year ago

bug with HAS or inline SYMBOL on venusq and maybe other devices

One venuSQ user reported that the battery stopped working. After few tests I have found that there is a bug with HAS or SYMBOLS.

This code 4.2.4/win10/eclipse on sim/venusq:

var

Symbol_getBB = :getBodyBatteryHistory;

lg("getInitialView :getBB1=" + :getBodyBatteryHistory + " hasBB=" + (Toybox.SensorHistory has :getBodyBatteryHistory));

lg("getInitialView :getBB2=" + Symbol_getBB + " hasBB=" + (Toybox.SensorHistory has Symbol_getBB));

shows

getInitialView :getBB1=symbol (8391839) hasBB=false

getInitialView :getBB2=symbol (8391839) hasBB=true

so I don't try to read BB to not allow to exception and show no data.

on f7 (on my real device there is no problem):

getInitialView :getBB1=symbol (8391839) hasBB=true

getInitialView :getBB2=symbol (8391839) hasBB=true

  • The same is with e.g. fr55

  • user info:

    https://forums.garmin.com/developer/connect-iq/f/showcase/260133/psx-1---stress-respiration---breath-body-temperature-mfp---myfitnesspal-weather/1617221#1617221

    ok, I've found problem...

    var

    Symbol_getBB = :getBodyBatteryHistory;

    System.println("getInitialView :getBB1=" + :getBodyBatteryHistory + " hasBB=" + (Toybox.SensorHistory has :getBodyBatteryHistory));

    System.println("getInitialView :getBB2=" + Symbol_getBB + " hasBB=" + (Toybox.SensorHistory has Symbol_getBB));

    when choose:

    I see

    getInitialView :getBB1=symbol (8391839) hasBB=true

    getInitialView :getBB2=symbol (8391839) hasBB=true

    but when choose:

    getInitialView :getBB1=symbol (8391839) hasBB=false

    getInitialView :getBB2=symbol (8391839) hasBB=true

    but in my opinion it should never happen

    (Toybox.SensorHistory has :getBodyBatteryHistory) = (Toybox.SensorHistory has Symbol_getBB)

  • I haven't reproduced this with my initial attempts. I've essentially lifted your code and included it in a new app, with some minor modifications (I don't know exactly what your lg() function has implemented, but I assume it's just printing to the console):

    You can see that I get true for both. This is using the 4.2.4 SDK running on Venu Sq in the simulator. I'm using Visual Studio Code rather than Eclipse, but that shouldn't matter in this case.

  • Just to confirm, you have a user with a Venu Sq that appears to be having this issue on device, you're able to reproduce this in the simulator (I assume while running as Venu Sq), but you don't see the problem on fenix 7 hardware. Is that correct?

    I'll play around with this and see if this is a general problem in the sim, or if it's an issue with only certain devices. I'm not sure how that could be, but it's worth some exploration.