Ivy-Apps / ivy-wallet

Ivy Wallet is an open-source money manager app for android that you can either build or download from Google Play.
https://play.google.com/store/apps/details?id=com.ivy.wallet
GNU General Public License v3.0
2.51k stars 580 forks source link

[BUG] Removing $0 balance account with transfer #3289

Open Jack-Works opened 2 weeks ago

Jack-Works commented 2 weeks ago

Please confirm the following

Describe the bug

Cannot remove no longer used account.

To Reproduce

Initial state:

  1. Create an expense of $20 with the credit card
  2. Transfer $20 from the bank to the credit card
  3. Delete credit card account (Emulate canceled credit card in the real life)

The bank account should be $80, but $100.

Expected behavior

I can remove (or hide) the credit card account.

Screenshots

No response

App version

2024.07.06 (181)

Smartphone

No response

Additional context

No response

ivywallet commented 2 weeks ago

Thank you @Jack-Works for raising Issue #3289! 🚀 What's next? Read our Contribution Guidelines 📚.

Tagging @ILIYANGERMANOV for review & approval 👀

ILIYANGERMANOV commented 2 weeks ago

Removing accounts also removes all of their transactions. For this one we should implement "archive" account functionality. I.e., hide the account from the UI but don't delete it

suyash01 commented 2 weeks ago

A quick inspection on the db shows that the transaction does not get deleted, but they are kind of hidden as there is no account reference to fetch them.

ILIYANGERMANOV commented 2 weeks ago

@suyash01 that was because of the cloud sync that we supported back in the days. We first mark an entry as deleted and then when synced with the cloud - permanently deleted. However, we've shutdown the Cloud sync and never migrated that code.

Now it's a good time to get rid of:

and directly execute DELETE cuz there's nothing to sync. We kept the room for cloud sync with server open cuz users wanted it but that's likely not happening. So let's simplify the code