Skip to content

Inconsistent database state when assigning transactions via rules to invalid buckets #254

@ramonwenger

Description

@ramonwenger

Describe the bug
First of all, I didn't realize that buckets are only valid from the month they were first created in. So I started with an import of my transactions of the last 6 months, and then started creating buckets and assigning transaction from the current month (June). I then started creating rules, which helped me using the "Propose Buckets" button, that then suggested the correct bucket.

When going back a month to May, the buckets did not exist / were not valid, so I couldn't choose them, but when using the "Propose Buckets" button, I could still choose the buckets defined in the rules, and save them. But, when returning to the month in question (May in my example), the UI returns an error, saying "Error during loading: Sequence contains no matching element". No transaction for May get displayed then, and I can't edit any transactions from May any more (April is fine again).

I assume that this has to do with the UI trying to display transactions that have invalid buckets, and then crashing. I cannot get out of this state though, as I can't remove the offending buckets from the transactions, so I'm afraid my database is in a bad state right now.

To Reproduce
Steps to reproduce the behavior:

  1. Create bucket in a certain month (e.g. June)
  2. Create a transaction in said month
  3. Create a rule to match this transaction to that bucket
  4. Go back a month (e.g. May)
  5. Create a transaction matching the rule
  6. Use "Propose Bucket" to then assign the transaction from earlier month to bucket in later month
  7. Try to go to earlier month after a reload
  8. The application should now display "Error during loading: Sequence contains no matching element"

Expected behavior
Let me assign newer buckets to older transactions and change the valid from date (or make it explicit), or prevent rules using invalid buckets for the current month from being applied.

Additional helpful details

  • Used version: 1.8.3
  • Database PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    ✅ Released

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions