timers, callback, background etc. and access to storage/vars conflict

From time to time I have crash during read data from storage and I don't know why.

Case:
view call app function that calls BAG.registerForTemporalEvent
BAG
- can be run in future depend on last TemporalEvent,
- of course BAG calls app.onBackgroundData in somewhen in future
in APP.onBackgroundData I save data from BAG to storage
view.onExitSleep read data form storage


So technically is possible that at 12.33 user move wrist and onExitSleep is triggered and the same moment BAG calls onBackgroundData.

I know, there is an bug with timer creation in onExitSleep() and maybe it the same problem refer to my case (I try use storage, and using timers and storage is forbidden in low power) but maybe my case is connected with conflict simultaneous read/write to storage.

Question: is it possible of app crash because of conflict accessing storage (BAG saving and view reading)?

  • the timer problem was nasty, you can download 19.78 and 20.00 beta versions for your watch. At least 19.78 all fenix 6(S/X/Pro) models has fixed the timer bug in onExitSleep if this helps?
    www8.garmin.com/.../download_details.jsp

  • I had (not know now because ERA doesn't work) error on:

    fēnix® 5X Plus: 15.40
    Captain Marvel: 6.20
    vívoactive® 4: 6.30
    vívoactive® 4S: 6.30
    vívoactive® 3: 7.40
    fēnix® 6S / 6S Solar / 6S Dual Power: 16.70
    Venu® Sq. Music Edition: 2.70
    Venu® Sq. Music Edition: 2.60
    Venu® Sq: 2.70
    and more

    I don't know if my issue is connected with timer in onExitSleeep() so I ask if is possible asynchronous conflict.

    In other words and in general: does the system call onTimer /onBackgroundData /all_asynchronous_function only when no other function is called? If yes, I have to protect against it...