Under Review
over 2 years ago

Missing entries in not handled the same in sim vs real devices

If you have a entry in <properties> but forget to add it to <settings> then saving settings in the sim via Ctrl-P works fine.  However, on the real device, when you save the settings via Connect IQ app, the missing Property is deleted on the device which then causes an unhandled exception when trying to fetch the value via Properties.getValue().

Normally, you'd think this would never happen because normally settings are simple and you'd notice them missing <settings> entry in the sim properties window.  However, when trying to support as many devices as possible, the limited memory on some require a different set of settings and it's easy enough to miss the missing setting when testing.

What makes this a more serious issue that you have to export a release version to beta and the bug reporting system is not reliable in getting bug reports.

IMO it is a bug that the real device deletes the property (or sets it to Null; I'm not sure which is happening).  But, I suspect it is easier to fix the sim to behave like the real devices.  This at least makes it a LOT easier to catch this bug.  It took 2 days of pushing various beta versions to multiple devices to finally figure out that the property is either gone or null; neither of which should ever happen if a property is defined, with valid values, in the <properties> file.

Thx,

Pete

Parents
  • You don't have to have properties in settings. You can want to hide some properties.

    But of course they shouldn't be deleted, are they? 

    I have similar error but for properties exposed in settings. I suppose it's connected with new installation of app.

    You can try/catch exception when there is no properties with given key but on my case don't work, bug is on system.

    I've found one case, when there is no memory to save settings system sets properties to null and typically of you try to do operation with null you can see  exactly unhandled exception error.

Comment
  • You don't have to have properties in settings. You can want to hide some properties.

    But of course they shouldn't be deleted, are they? 

    I have similar error but for properties exposed in settings. I suppose it's connected with new installation of app.

    You can try/catch exception when there is no properties with given key but on my case don't work, bug is on system.

    I've found one case, when there is no memory to save settings system sets properties to null and typically of you try to do operation with null you can see  exactly unhandled exception error.

Children
  • I found that if leave out any properties in the settings file, the missing ones are either set to null or delete (I didn't check; they are probably being set to null).

    And yes, try/catch takes care of it.

    The problem is that the sim does not behave the same; it does not set them to null.  So, I didn't get any errors until I tried testing Beta versions and then the lack of bug reports made it really hard to debug.  After two days I finally got one bug report even though it was crashing on several devices.

    So, 2 days was very painful and could have been avoided if the sim behaved the same as the device.