Ticket Created
over 3 years ago

CIQQA-687

calling getOxygenSaturationHistory throws Unexpected Type Error

sdk 4.0.6
eclipse plug in 4.1.0.beta1
eclipse Version: Version: 2021-09 (4.21.0) Build id: 20210910-1417
windows 10
watch face
minSdkVersion 2.4.0

fenix 6s sumilator (not known  on device)

running sdk sample SensorHistory

Error: Unexpected Type Error
Details: Failed invoking <symbol>
Exception: UnexpectedTypeException: Expected null/Number, given null

throws exception in

function getIterator() {
        if ( ( Toybox has :SensorHistory ) && ( Toybox.SensorHistory has mSensorSymbols[mIndex] ) ) {
            var getMethod = new Lang.Method( Toybox.SensorHistory, mSensorSymbols[mIndex] );
            return getMethod.invoke( {
            } );
        }
        return null;
    }

for :getOxygenSaturationHistory

strange is exception

Error: Unexpected Type Error
Details: Failed invoking <symbol>
Exception: UnexpectedTypeException: Expected null/Number, given null

  • 4.0.7 also MARQ


    Error: Invalid Value
    Details: Failed invoking <symbol>
    Stack:

  • sdk 4.0.7  and on 6s still crash but now:

    Error: Invalid Value
    Details: Failed invoking <symbol>
    Stack:

    But, I can assume that code run without crash on device, yes?

  • the problem is in invoke because when I call:

                         if((Toybox has :SensorHistory) && (SensorHistory has :getOxygenSaturationHistory))
                        {
                            try
                            {
                                i= SensorHistory.getOxygenSaturationHistory(null);
                            }
                            catch(ex)
                            {
                                i= null;
                            }
                        }

    there is no error

  • Can you confirm that crash is only on f6s-sim but not on device (I don't need data from iterator, only iterator)?

    Why exception isn't catch?

           ...
           i = new LAN.Method(SHI, :getOxygenSaturationHistory);
           try
            {
                    i = i.invoke({ :period => 1, :order => 0});
            }
            catch(ex)
            {
                i = null;//<<<<< after exception system should jumps here
            }
            ....

    Error: Unexpected Type Error
    Details: Failed invoking <symbol>
    Exception: UnexpectedTypeException: Expected null/Number, given null

  • in my case I want only get iterator to check getNewestSampleTime().

    So, crash is only in the sim (yes only for 6s I've noticed) and on device there is problem with values and no crash.