simpletask-android icon indicating copy to clipboard operation
simpletask-android copied to clipboard

Fix bug where notifications can disappear/lose association with task

Open camgraff opened this issue 3 years ago • 1 comments

Since adding the ability to pin tasks as notifications in #1170 I've found a couple issues with the current implementation. Namely:

  • Sometimes pinned notifications will randomly disappear. It seems like this was caused by the app being restarted by the OS/crashing in the background as I could reproduce in an emulator by running adb shell am force-stop nl.mpcjanssen.simpletask.debug.

Solution: Create the notifications from a Service and call startForeground.

  • If the todo list is modified outside of simpletask, the task IDs will change causing the notifications to lose their association with each task.

Solution: Make the task IDs persistent by storing them in SharedPreferences.

camgraff avatar Jul 25 '22 01:07 camgraff

@camgraff, thank you for this PR. It does seem to have quite a few moving parts so I would like to review it or at least understand it in a bit more detail. Unfortunately I do not have time for that right now so it's going to take some time for this to be merged.

mpcjanssen avatar Jul 28 '22 10:07 mpcjanssen