Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group balances broken on 1 to 1 expenses #190

Open
krokosik opened this issue Feb 13, 2025 · 0 comments · May be fixed by #191
Open

Group balances broken on 1 to 1 expenses #190

krokosik opened this issue Feb 13, 2025 · 0 comments · May be fixed by #191

Comments

@krokosik
Copy link

When adding a group expense, I noticed some weird behaviour where the balances are reset to 0 if the expense involves only 1 person owing another different person.

How to replicate

  1. Seed the database and login as Alice
  2. In the Holiday Trip group create an expense where the full amount is paid by Bob and Alice is the only debtor
  3. The balance is not reflected in our group view

What is more, I checked with pgAdmin that if it happens with an existing balance, it is reset to zero! This is a critical issue as it can really mess up a group and all expenses would have to be added again.

I looked in the code and saw a function called updateGroupExpenseForIfBalanceIsZero in splitService.ts. Its purpose is unclear to me, as it seems to set the group balances to 0 if the total balance with our friend is zero. This is quite odd to me, as groups should be independent of what happens outside off them, but maybe @KMKoushik could you tell me more about the reasoning behind it?

Nevertheless, it has a bug and I am submitting a fix, which I believe should be released ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant