nazrinharris / pecunia

Massively ambitious personal finance app.
1 stars 0 forks source link

Unable to delete account when there's a lot of transactions #170

Closed nazrinharris closed 3 weeks ago

nazrinharris commented 5 months ago

I added a total of 700ish transactions, and when I want to go about deleting it, it is simply unable to. Not sure why will need to investigate more

nazrinharris commented 3 weeks ago

Is it really because of the amount of transactions? Or is it due to how I added said 700ish transactions?

Also note that I wasn't able to delete even one transaction from the test account with a bunch of transactions.

Okay, but it seems I'm able to delete the "Throwaway Account" that's in the simulator. Of which I can't delete the whole account.

nazrinharris commented 3 weeks ago

It seems like this part of the code is the culprit

 if (calculatedBalance != account.balance) {
      print(TransactionsErrorType.mismatchAccountBalance.message);
      print(StackTrace.current);
      throw TransactionsException(
        stackTrace: StackTrace.current,
        errorType: TransactionsErrorType.mismatchAccountBalance,
      );
    }

The if statement is directly comparing, too specific per say. Should use the epsilon thang.

nazrinharris commented 3 weeks ago

Should be completed e244360 in #132