NidukaAkalanka / x-ui-english

English Version of X-UI, A Multi-protocol & Multi-user Xray Panel with a Web UI and a TG Bot
GNU General Public License v3.0
727 stars 239 forks source link

Update: I just tested it and confirm this problem. Here is how to replicate: make a client with an email or name. Then delete it. and Make it again with the same name or email and the error starts to show up. #121

Closed amihos closed 1 year ago

amihos commented 1 year ago
          Update: I just tested it and confirm this problem. Here is how to replicate: make a client with an email or name. Then delete it. and Make it again with the same name or email and the error starts to show up.

Originally posted by @amihos in https://github.com/NidukaAkalanka/x-ui-english/issues/106#issuecomment-1381984355

NidukaAkalanka commented 1 year ago

Hi there @amihos !

Seems like you are creating the issue by yourself.

There's a loop icon beside the text area where you have to type the email. Just click it and it will generate an email address which won't causing problems like this. There's no need to provide actual email addresses as it isn't going to send any emails to it. It is just used as an identifier. When duplicated ones being used, it'll confuse the script and end up giving an error.

Please refer the screenshot below to know the loop icon that I'm talking about. Screenshot_2023-01-27-09-28-20-300-edit_com android chrome

amihos commented 1 year ago

Using random generated identifiers is not the best way to manage users. Specially when you are concerned about their consumption and/or expiray. In this scenario you don't know who is who. One should use names or emails or anything that admin recognize.

However this is not the issue! The issue comes from the fact that when you create a user with whatever identifier, if you remove it immediately it won't get removed from database. So if you later use the very same identifier even though you think it's only one in the panel, actually there are two items in the database and hence the error comes.

So the question is why when you remove an identifier from panel, it won't get removed from database?