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

Deactivated users reappeared #1080

Open
pH142857 opened this issue Oct 17, 2022 · 9 comments · May be fixed by #1104
Open

Deactivated users reappeared #1080

pH142857 opened this issue Oct 17, 2022 · 9 comments · May be fixed by #1104

Comments

@pH142857
Copy link

I created a project on https://ihatemoney.org/ for my house. Two flatmates left, I balanced their accounts to 0€ and deactivated them. Several expenses later, they reappeared with a positive balance, even though they are still deactivated. How is that possible and how to prevent it?
Merci d'avance.

@Glandos
Copy link
Member

Glandos commented Oct 22, 2022

Hi, thanks for the report.
Will trying to reproduce it, I did the following scenario:

  • Start from empty project with 3 participants
  • Add 2 bills, each one from one participant to the last one
  • Balance one participant to 0 (by issuing a reverse bill), and deactivate it
  • Modify the initial bill of the deactivated participant
  • => It's now a mess.

It seems that the deactivated participant is not displayed in the bill edit form, even if we are editing a bill with the deactivated participant as the payer.

@pH142857 Do you think it happens because of a bill edition? Or maybe a bill removal?

@pH142857
Copy link
Author

Aaah, yes you're right. Chronologically,

  • A bill has been created with some users involved,
  • 2 involved users have been balanced to zero then deactivated,
  • The bill has been edited to remove them from it (because it probably was a mistake)
    So this is logical after all, but it's an "illegal" move made possible.

So the solution would be either :

  • to make it plainly impossible to remove/add a deactivated user from a bill, or
  • to issue a warning "this will reactivate this user, continue yes/no ?" and if yes, reactivate the user.

@Glandos
Copy link
Member

Glandos commented Oct 24, 2022

Thanks for the confirmation.

I've played around with bill edit form. At least, I've added back the deactivated payer and payees that are part of the bill. Now, I'm wondering how to render them. The trickiest part is that damn HTML select are nearly not customizable. The text are just basic, without styling at all. It is possible to style the payee list labels, but it will be inconsistent with the select.
So my best shot so far is to add a (ugly) (deactived) suffix:
image

The warning is a bit difficult to generate here, if we want to try to detect something on the deactivated people. But we can add a generic one, in case of the form has at least one deactivated user.

@almet
Copy link
Member

almet commented Nov 24, 2022

I think I would prefer to make this impossible to do without reactivating the users first. That would be easier to do and not clutter the UX?

@FlowingCloudRTL
Copy link
Contributor

As a continuation of this conversation. I was able to create replicating active participant name by first deactivate a user, add a new user with same name, then change their initial bill and activate the user again
image
image
This can be address by either not allowing participant name to be created if they are used by deactivated user, not allow an user to be re-activated if there is currently another active participant with the same name, or just not allowing bills revolving deactivated participant to be edited at all.

@FlowingCloudRTL
Copy link
Contributor

Would it be possible for me to work on this issue?

@chestnutFan chestnutFan linked a pull request Dec 10, 2022 that will close this issue
@chestnutFan
Copy link

chestnutFan commented Dec 10, 2022

[BugFIx #1104] Have fixed this issue by banning editing (and deleting, which would also trigger this problem) bills involving deactivated users. Corresponding test functions were committed together.

This is my first time contributing to an open-source project. Learned a lot from your code. Thanks very much : )

@mzhongqi
Copy link

mzhongqi commented Dec 10, 2022

As a continuation of this conversation. I was able to create replicating active participant name by first deactivate a user, add a new user with same name, then change their initial bill and activate the user again image image This can be address by either not allowing participant name to be created if they are used by deactivated user, not allow an user to be re-activated if there is currently another active participant with the same name, or just not allowing bills revolving deactivated participant to be edited at all.

#1106 Resolved the above issue proposed by @FlowingCloudRTL, ensuring that duplicated user names with deactivated users in the dataset are not allowed (Since they are deactivated but not deleted because they are bounded by a bill/bills).

@almet
Copy link
Member

almet commented Dec 11, 2022

Tracked in #1104

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.

6 participants