emavgl/oinkoin

Number of future recurrent records gets doubled

jiru opened this issue · 3 comments

Using 1.0.44 APK release from GitHub, one should be able to reproduce this bug.

  1. Now is the 28th of January, 2024.
  2. Clear app storage and start app.
  3. Tap "calendar", show records per year, 2024
  4. Tap "+" to add a new record: set amount to 10, set date to at least one week later (4th of February or later), set repeat every week.
  5. Two new records show up: on the 5th and 12th of February. Total expenses is 20.
  6. Tap any of these records.
  7. Tap "←" to go back.
  8. Two new records show up: on the 19th and 26th of February. Total expenses is 40.
  9. Repeat from step 6 and notice the number of records is doubled every time.

It looks like the doubling of records happens regardless of the calendar view. In other words, even after 2024 is full of weekly records, the app will keep adding new records to 2025 and so on, resulting in exponential growth of the database. Attempting to backup the database produces an ever growing file that can easily turn into several megabytes of json.

I was also able to reproduce this bug with biweekly and daily recurrent records, but not monthly ones.

By the way, my use case is to check how some combination of weekly, monthly and quarterly expenses and incomes would sum up in the next few months. I wonder if the recurrent records functionality could be used in that way.

https://github.com/emavgl/oinkoin/releases/tag/1.0.45 contains a patch for it. Recurrent records creates the records until the date of today. So I fear it is not possible to have an outlook for the future, it would be interesting though. I'll close the issue since the it should be fixed with 1.0.45. Feel free to comment/open it in case it is not. Regarding your use case, I'll keep in mind and I see if I can get an idea on how to achive that, if you want, you can open another issue as feature request for it.

Your use-case has also been pitched here: #83