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

When users are added to group from .csv file last character of e-mail address is getting deleted #93

Closed
tomlebl opened this issue May 24, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@tomlebl
Copy link
Contributor

tomlebl commented May 24, 2024

When users are added to group from .csv file last character of e-mail address is getting deleted

@tomlebl tomlebl added the bug Something isn't working label May 24, 2024
@hunxjunedo
Copy link
Contributor

requesting assignment, if open to external contributions.

@tomlebl
Copy link
Contributor Author

tomlebl commented May 27, 2024

@hunxjunedo You are more than welcome to have a look on this one.
I guess that the problem is at frond-end Groups.jsx container where I introduced some sanitization after .csv is read and converted to an array. When I was reading files with two columns username | email , I was getting emails with a comma at the end. So, I just deleted the last character which appears to be a shortcut solution because some other users report that they are getting e-mails without the last characters. It probably depends on a format of the .csv file that is used as the input.
If you need some more hints and guidance let me know.

@hunxjunedo
Copy link
Contributor

I don't feel the need to setup the whole environment for this particular issue, therefore I'm just isolating the CSVreader function in a seperate env, then once its fixed I'll create a pull request.

@hunxjunedo
Copy link
Contributor

hunxjunedo commented May 27, 2024

I've almost reached out the solution, but I need some test data to ensure this never happens again. It will be really appreciated.
If a CSV file has a username and email in a row, should both of them be counted as one username or should they be separated ?

@tomlebl
Copy link
Contributor Author

tomlebl commented May 27, 2024

The first column username has to be defined. The second column email is optional. If email is not defined it gets created from username and suffix defined in environmental variables. You can check addUsers controller in /controllers/admin/groups.js to see what happens on the backend.
csv test data.csv
Here is an example of csv file that works that seems to work in the current version. I have asked the user who reported this bug to send me one that does not seem to work in the current version.

@hunxjunedo
Copy link
Contributor

hunxjunedo commented May 27, 2024

got it, one last thing: for the input: new_user,test@gmail.com what should be the valid output ? should it be new_usertest@gmail.com or new_user,test@gmail.com

EDIT: I got it, check the PR

tomlebl added a commit that referenced this issue May 31, 2024
@tomlebl
Copy link
Contributor Author

tomlebl commented May 31, 2024

@hunxjunedo
It seems to work. Thanks.
You are more than welcome to help with another one. At the moment, there is nothing as easy as this one. So, you would need to get a bit more involved and set the dev environment. It is all set up in Docker and relatively easy to get going.
Currently, I don't have any funds to pay developers but could buy you a coffee sometimes.

@tomlebl tomlebl closed this as completed May 31, 2024
@hunxjunedo
Copy link
Contributor

Appreciate that mate, looking forward to contributing to this repo.

@tomlebl
Copy link
Contributor Author

tomlebl commented May 31, 2024

#91 is related to what you have done but it would require changes in both frontend and backend and you would need to set the project up properly on your machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants