CorruptedArk / did-i-take-my-meds

A Kotlin Android app to manage medications
GNU General Public License v3.0
175 stars 15 forks source link

Editing a record should recalculate closest dose #80

Open bannurowi opened 1 year ago

bannurowi commented 1 year ago

Describe the bug When editing a dose, it retains its connection to the original closest dose regardless of what dose is closest to the new time.

To Reproduce Steps to reproduce the behavior:

  1. Log a dose as taken.
  2. Tap the dose record and edit the time taken.
  3. The "closest dose" will remain the same, even if it is no longer actually the closest.

Expected behavior Editing the taken time should recalculate which dose is the closest.

Smartphone (please complete the following information):

Additional context This is most relevant to me when I take a dose on time, but forget to log it in the app. By the time I remember, the next dose is assumed to be the "closest" one, so I can't log both doses as actually taken.

This was previously mentioned here: https://github.com/CorruptedArk/did-i-take-my-meds/issues/42#issuecomment-1179412265, but it's really a separate issue.

nogweii commented 1 year ago

Yeah, this would be very appreciated. In the mean time, you can export the database, edit the record, then restore the changed version.