ARK-Builders / ARK-Navigator

Android app for navigation through your data
MIT License
15 stars 15 forks source link

Coroutines finalizer #173

Open kirillt opened 2 years ago

kirillt commented 2 years ago

In case of the app crashing, we can lose coroutines which haven't been completed. We might need to write more asynchronous code but we can't allow modules like tags storage to lose new data.

We should implement global exception handler ("last frontier"), which knows about spawned coroutines and ensures they complete before crashing. The same handler would send crash reports (#78).

kirillt commented 2 years ago

Also this finalizer should be called when a user wants to kill the app, but we have some active coroutines. In this case, the user should see progress spinner with label "Saving".