Hi,
Over the last week my app has crashed on over 70 devices which means there's a new bug. It crashes at
if(! isSessionRecording() || AppConfig.isAutoLapEnabled()==null || !AppConfig.isAutoLapEnabled() || AppConfig.getLapDistance() ==null || AppConfig.getLapDistance() < 0.01){ return null; } .... public function getLapDistance(){ return Properties.getValue("auto_lap_distance"); } public function isAutoLapEnabled(){ return Properties.getValue("auto_lap_enabled"); } public function isSessionRecording(){ return mSession!=null && mSession.isRecording(); } ... properties.xml ... <property id="auto_lap_distance" type="float">1</property> ... <setting propertyKey="@Properties.auto_lap_distance" title="@Strings.auto_lap_distance_title" prompt="@Strings.auto_lap_distance_prompt"> <settingConfig type="numeric" min="0.1" max="99"/> </setting>
I recently changed property type of lap distance from number to float in the properties because I wanted it to be 0.01 -> 99 (km/miles) rather than 1-99,000 (m).
The exception is:
Error Name: Unhandled Exception
Occurrences: 74
First Occurrence: 2021-09-08
Last Occurrence: 2021-09-14
Devices:
fēnix® 6 / 6 Solar / 6 Dual Power: 16.70
fēnix® 5 Plus: 15.40
Upcoming Wearable: 4.67
fēnix® 6X Pro / 6X Sapphire / 6X Pro Solar / tactix® Delta Sapphire / Delta Solar / Delta Solar - Ballistics Edition / quatix® 6X / 6X Solar / 6X Dual Power: 19.20
fēnix® 6X Pro / 6X Sapphire / 6X Pro Solar / tactix® Delta Sapphire / Delta Solar / Delta Solar - Ballistics Edition / quatix® 6X / 6X Solar / 6X Dual Power: 16.80
Descentâ„¢ Mk2 / Descentâ„¢ Mk2i: 4.20
Forerunner® 245: 7.80
vÃvoactive® 4: 6.30
vÃvoactive® 3: 7.80
vÃvoactive® 4S: 6.30
App Versions: 0.0.30
Languages: ces, cht, dut, eng, fre, gre, hun, ind, lit, pol, rus, slo, spa
Backtrace:
SessionManager.checkAutoLap:285
BaseView.handleTimer:135
MapperView.handleTimer:194
Line 285 is the If condition. I wondered if there's now some data of the wrong type in lots of device memory, or something else is subtly wrong. Is there any way to determine what the issue is that I haven't thought of? I cannot recreate it locally and the exception is pretty vague.
If have temporarily added:
try{ lastLapStats= mSessionManager.checkAutoLap(); }catch(ex){ //System.println("Exception processing autolap:" + ex); }
and the below to the 'if' condition in the hope that hides the problem
|| !( AppConfig.getLapDistance() instanceof Toybox.Lang.Float)
but I'm not confident auto-lap will be working on all devices unless they update the lap distance value themselves (causing it to re-save), or do something else to ensure the value is compatible.
Should I, for example, change the property name and accept that everyone will have their auto-lap distance reset (or perhaps I'm missing the real bug in the code above)?