Complete
over 4 years ago

CIQQA-164

F5 can't save to Storage from Background (while F6 and others can)

Fénix 5 serie can't Toybox.Application.Storage.setValue from a Background process => throws an Exception. 

Fénix 6 and others like FR245 can. 

  1. It's not documented
  2. Bug or feature? 
  3. How to test programmatically if the device can saving to Storage from background without always needing to throw and catch such exception that is dirty, ugly and inefficient?
Parents
  • I’d like to save to Storage on the Background to transfer more data to the App than is possible by Backround.exit.

    Background.exit runs out of memory very unpredictably across devices anywhere between 2-6k of free memory.

    By saving to Storage right from the Background more data could be transfered without a crash.

Comment
  • I’d like to save to Storage on the Background to transfer more data to the App than is possible by Backround.exit.

    Background.exit runs out of memory very unpredictably across devices anywhere between 2-6k of free memory.

    By saving to Storage right from the Background more data could be transfered without a crash.

Children
  • I do get user feedback regarding issues in their F5 and FR935 (just to name some) that I cannot reproduce in a F6 or FR945. Since I don't have any "older" generation physical test devices, I cannot corroborate the user reports of issues they experience. In the simulator it's not reproducible. All devices have 3.2.x compatible firmware.

    There seems to be CiQ implementation differences between e.g. F5 and F6 that are not reproducible in the simulator. Maybe having a better, more accurate and configurable simulator would be the best way to help in developers tackle these "inconsistencies".

    Anyway, according to the docs you should be able to write to storage from background context from CiQ 3.2 onward. Best solution is a CiQ-side bug-fix.

    Maybe you need to try-catch that storage call, and possibly abort it when its not possible to write (or throw your own exception with more info). Or maybe there's something else you could do...

    Sounds like your hitting the limits of what can be done, that is exciting!