Expensify.Cash - Unable to add multiple emails to workspace separated by comma
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Login to expensify.cash using an account under freePlan beta
- Create a workspace via Global create (i.e. the green + icon)
- Go to Settings and access the Workspace
- Go to People tab
- Select "Invite"
- Attempt to invite multiple valid email addresses and separate them by comma

Note: you will need to be a part of the freePlan beta to test this issue. if you are hired, please let us know your test email/s and we can add you!
Expected Result:
Multiple users should be added to this workspace (i.e. emails should be able to be separated by commas).
Actual Result:
"Invalid Email" error occurs:

Workaround:
N/A
Platform:
Where is this issue occurring?
Web ✔️ iOS✔️ Android✔️ Desktop App✔️ Mobile Web✔️
Version Number: 1.0.77-2
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Posted to Upworks: https://www.upwork.com/jobs/~0185dff64f02b86eaf
Triggered auto assignment to @marcaaron (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
I have a suggestion to improve the input. I think this input for entering emails should expand based on the number of emails.
Proposal
- We have to update
inviteUsermethod https://github.com/Expensify/Expensify.cash/blob/f1ea424068fea065809c95f8a32ff2e08d7d52dc/src/pages/workspace/WorkspaceInvitePage.js#L74. We split theemailorPhonestate property via,and then validate each email or phone input as we are currently doing. - We will update the state variable name to be more relavant.
- We will highlight the email which is wrong in the Error Growl.
- We have to update the
invitemethod https://github.com/Expensify/Expensify.cash/blob/f1ea424068fea065809c95f8a32ff2e08d7d52dc/src/libs/actions/Policy.js#L142. So that it takes an array of login instead of a single user. we already support multiple employees in https://github.com/Expensify/Expensify.cash/blob/f1ea424068fea065809c95f8a32ff2e08d7d52dc/src/libs/actions/Policy.js#L154.
This will fix the issue at hand.
Suggestions
- We should highlight the User emails in the input for clarity for example
[email protected],
[email protected] - We should increase the height of the input so that it is easier to see all the entered emails and wrap emails in next line.
@parasharrajat, your proposal sounds right for this. I think you can go ahead and work on it!
3. We will highlight the email which is wrong in the Error Growl. - not strictly necessary, but would be a very helpful feature - I like it.
For the first suggestion, what do you mean by We should highlight the User emails in the input for clarity. Do you mean to literally just bolden the emails?
Yeah, I meant bolden the emails as we currently don't have Email Input fields where each email is shown with a close button to interact separately instead of using backspace to remove it.
Hey @TomatoToaster, Str.isValidPhone is returning true for 98?
I found the following issues while working on this.
- If we invite a phone number, It is not added to the assignee list until we refresh the page.
Str.isValidPhoneis returning true for value98?
Thanks for the investigation @parasharrajat - I'll go ahead and hire you for this job.
Hey, @TomatoToaster Please check https://github.com/Expensify/Expensify.cash/issues/4029#issuecomment-880087243. What do you think?
If we invite a phone number, It is not added to the assignee list until we refresh the page.
Ooh now this is weird. I would think the optimistic addition from here would add them in. Did it work before with just one phone number?
Str.isValidPhone is returning true for value 98? When I read this, I thought this must be a bug, but it turns out it's technically right 😖 ?
It looks like we're using the E.164 specification and technically those can be valid international numbers. 2 digits seems really short, but I think that's fine since it matches the specification. A source I found for this: https://stackoverflow.com/questions/6478875/regular-expression-matching-e-164-formatted-phone-numbers/23299989#23299989
Some others buffer it by more digits, but I don't think we need to change this part.
Ooh now this is weird. I would think the optimistic addition from here would add them in. Did it work before with just one phone number?
I think the list expects emails so a ph number should be converted to @expensify.sms email first.
Some others buffer it by more digits, but I don't think we need to change this part.
Ok.
What is the update on this change?
@MitchExpensify PR merged https://github.com/Expensify/App/pull/4068
It's been deployed recently to prod I believe.
Paid, sorry for the delay @parasharrajat !