Android notifications should auto-dismiss

The current behavior of notifications from the Android app has several problems.

  1. Sometimes when the safety buffer is increased a lot (like a goal with a rate of 1/week where I just entered 1) the notification sticks around, but the time until derailment is now longer than my setting for how early to start reminding me. I.e., the goal shouldn’t be alerting at all. I think this might happen when I go into the Android app without clicking the notification (which I always do, because clicking the notification dismisses it, and then I might get distracted and not record my data point) and post a data point, but I’m not sure. This is especially annoying because the change to the notification makes it alert my Pebble again (I think it would be the same for other smartwatches; they use the same API for notifications).
  2. Sometimes the time until derailment sticks at whatever it was, though it shouldn’t. E.g. I got a 1h zeno poll, then I posted some data and I now have a day until derailment, but the notification still says 1h. The app does know about the datapoint; my widget has the updated safety buffer. It’s only the notification that’s wrong. I think this might happen when the data point is posted externally, like through the website, but again I’m not sure.
  3. When a goal has derailed, the notification sticks around with whatever the last zeno poll time was (e.g. 2s). Okay, I guess it’s fine to have the notification for a derailed goal stick around until it’s dismissed, but it should say “derailed”, not an incorrect time until derailment.

In my opinion, the logic should be: any time the goal is updated (by the app itself or externally), and the safety buffer is at least 1 day longer than it was before the update, dismiss any active notification for that goal. If the buffer is still less than my reminder threshold, it will alert me again tomorrow. (If it instead updated the notification, that would make smartwatches vibrate, which is more annoying than it sounds coming an unpredictable time after I posted some data. I suppose you could try to check whether the user actually has a smartwatch or something, but that seems like overkill.)