Skip to content

Confusing error on adding self account to new chat or group #4749

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

Closed
akshayasalvi opened this issue Aug 18, 2021 · 10 comments
Closed

Confusing error on adding self account to new chat or group #4749

akshayasalvi opened this issue Aug 18, 2021 · 10 comments
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Improvement Item broken or needs improvement. Weekly KSv2

Comments

@akshayasalvi
Copy link
Contributor

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:

  1. Click on FAB
  2. Click on New Chat or New Group chat
  3. Enter the logged-in user's email in the search field
  4. Click on Add you'll see a confusing error.

Expected Result:

  1. It should throw a more user friendly error.
  2. It shouldn't show up logged in user account when searching with self account.

Actual Result:

Shows an error: "500 need to pass atleast 2 accounts"

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
image

Platform:

Where is this issue occurring?

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:

View all open jobs on GitHub

@akshayasalvi akshayasalvi added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Aug 18, 2021
@MelvinBot
Copy link

Triggered auto assignment to @johncschuster (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Aug 18, 2021
@akshayasalvi
Copy link
Contributor Author

Proposed Solution

In OptionListUtils.js there's a handling missing to hide logged in account during search.

let userToInvite = null;
if (searchValue
    && recentReportOptions.length === 0
    && personalDetailsOptions.length === 0
    && _.every(selectedOptions, option => option.login !== searchValue)
    && ((Str.isValidEmail(searchValue) && !Str.isDomainEmail(searchValue)) || Str.isValidPhone(searchValue))
    && (searchValue !== CONST.EMAIL.CHRONOS || Permissions.canUseChronos(betas)
    
    && searchValue !== currentUserLogin)  // NEW ADDITION for FIX
) {


Add the searchValue !== currentUserLogin to the userToInvite block's in the code.

Second way, is to make a more reader friendly errors such as "Cannot chat with own/self account"

@johncschuster johncschuster added Weekly KSv2 and removed Daily KSv2 labels Aug 18, 2021
@johncschuster
Copy link
Contributor

I have reproduced this by being logged in as [email protected] and attempting to create a New Chat with [email protected]. 👍

@MelvinBot
Copy link

Triggered auto assignment to @pecanoro (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@pecanoro pecanoro removed their assignment Aug 19, 2021
@pecanoro pecanoro added Improvement Item broken or needs improvement. External Added to denote the issue can be worked on by a contributor labels Aug 19, 2021
@MelvinBot
Copy link

Triggered auto assignment to @SofiedeVreese (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@SofiedeVreese
Copy link
Contributor

Posted to Upwork: https://www.upwork.com/jobs/~0107be2dcefa1bc350

Assigning a CME now to review @akshayasalvi 's proposal.

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 19, 2021
@MelvinBot
Copy link

Triggered auto assignment to @NikkiWines (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@SofiedeVreese
Copy link
Contributor

hey @NikkiWines please see @akshayasalvi 's proposal above

@aman-atg
Copy link
Contributor

aman-atg commented Aug 19, 2021

I think this will be solved after closing of #4325.

@johncschuster johncschuster added Weekly KSv2 and removed Daily KSv2 labels Aug 19, 2021
@Julesssss
Copy link
Contributor

Hi @akshayasalvi, thanks for raising the issue and suggesting a proposal.

By coincidence, we have just merged the fix you mentioned to solve another issue. I'm going to close this as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Improvement Item broken or needs improvement. Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants