Repository navigation
[$500] Room - Can invite valid phone account multiple times into the room #30190
Description
Activity
- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributorDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Oct 23, 2023 Triggered auto assignment to @greg-schroeder (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.- changed the title
[-]Room - Can invite invalid phone account multiple times into the room[/-][+][$500] Room - Can invite invalid phone account multiple times into the room[/+]on Oct 23, 2023 Job added to Upwork: https://www.upwork.com/jobs/~01da7f12cf9ed3d23f
Bug0 Triage Checklist (Main S/O)
- This "bug" occurs on a supported platform (ensure
Platformsin OP are ✅) - This bug is not a duplicate report (check E/App issues and #expensify-bugs)
- If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
- This bug is reproducible using the reproduction steps in the OP. S/O
- If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
- If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
- This issue is filled out as thoroughly and clearly as possible
- Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
- I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
- This "bug" occurs on a supported platform (ensure
- addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Oct 23, 2023 Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (
External)I think number provided number(
+3233232432) is valid number@alitoshmatov you can try with a new chat. the backend return invalid
I think issue should fixed in backend.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Room allows multiple invitation for phone number which is already a member.
What is the root cause of that problem?
The problem is not invalid phone numbers can be invited multiple times (as commented in the title of the issue). It correctly validates when you input wrong number but for valid phone numbers it let's you invite it multiple times without validating and informing the user that the phone number is already a member of the room as it correctly does for emails.
This is because of a bug which lies in this line of code
App/src/libs/OptionsListUtils.js
Lines 1237 to 1238 in 844b3b9
!_.find(optionsToExclude, (optionToExclude) => optionToExclude.login === addSMSDomainIfPhoneNumber(searchValue).toLowerCase()) && (searchValue !== CONST.EMAIL.CHRONOS || Permissions.canUseChronos(betas)) &&
Because it is comparing existing login list of members of the room (optionsToExclude) with the phone number input (searchInput) of the user passed to theaddSMSDomainIfPhoneNumberfunction which concatinates '@expensify.sms' to thesearchInput. But as I observed the login value for the phone number only holds the phone number without '@expensify.sms' concatination. Hence, existing phone numbers will never be filtered out as the comparison will always be false.What changes do you think we should make in order to solve the problem?
Change
App/src/libs/OptionsListUtils.js
Lines 1237 to 1238 in 844b3b9
!_.find(optionsToExclude, (optionToExclude) => optionToExclude.login === addSMSDomainIfPhoneNumber(searchValue).toLowerCase()) && (searchValue !== CONST.EMAIL.CHRONOS || Permissions.canUseChronos(betas)) &&
to!_.find(optionsToExclude, (optionToExclude) => optionToExclude.login === searchValue.toLowerCase()) &&Result:
10.New.Expensify.mp4
What alternative solutions did you explore? (Optional)
May be if this code is also necessary to support for previous login info (if there was time where we used to save phone number concatinated with '@expensify.sms' ) we could add an or condition to support for both situations like
!_.find(optionsToExclude, (optionToExclude) => optionToExclude.login === searchValue.toLowerCase() || optionToExclude.login === addSMSDomainIfPhoneNumber(searchValue).toLowerCase()) &&72 remaining items
- changed the title
[-][$500] Room - Can invite valid phone account multiple times into the room[/-][+][HOLD for payment 2024-02-07] [$500] Room - Can invite valid phone account multiple times into the room[/+]on Jan 31, 2024 Reviewinglabel has been removed, please complete the "BugZero Checklist".The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.33-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-02-07. 🎊
For reference, here are some details about the assignees on this issue:
- @rushatgabhane requires payment through NewDot Manual Requests
- @DylanDylann requires payment automatic offer (Contributor)
- @namhihi237 requires payment automatic offer (Reporter)
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
- [@rushatgabhane / @DylanDylann] The PR that introduced the bug has been identified. Link to the PR:
- [@rushatgabhane / @DylanDylann] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
- [@rushatgabhane / @DylanDylann] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
- [@rushatgabhane / @DylanDylann] Determine if we should create a regression test for this bug.
- [@rushatgabhane / @DylanDylann] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
- [@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Seems like the PR for this was reverted again 😬 #35335 so no payment due yet
Reacted by Rushat GabhaneRIP
Reacted by Rushat Gabhane- removedAwaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to production
on Feb 6, 2024 - changed the title
[-][HOLD for payment 2024-02-07] [$500] Room - Can invite valid phone account multiple times into the room[/-][+][$500] Room - Can invite valid phone account multiple times into the room[/+]on Feb 6, 2024 Are we even going to move forward here at all? It seems this might not actually go forward with another PR based on what @mountiny is saying in the linked PRs
@rushatgabhane @mountiny I cannot reproduce this issue in staging anymore. Can anyone help confirm?
- addedretest-weeklyApply this label if you want this issue tested on a Weekly basis by ApplauseApply this label if you want this issue tested on a Weekly basis by Applause
on Feb 13, 2024 Added
retest-weeklyto get more eyes from applause, would be great if this got fixed automagically somehow 😅 😳Reacted by Rushat GabhaneI also couldn't repro, I think I'm going to close this given two failures to reproduce and also #30190 (comment). Reopen if you disagree
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.3.89.6
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @namhihi237
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1698051749271339
Action Performed:
Expected Result:
The app should show an error when inviting an invalid phone number
Actual Result:
The system does not show errors and may invite invalid phone numbers multiple times
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
Screen.Recording.2023-10-23.at.19.42.26.mov
Android: mWeb Chrome
Screen.Recording.2023-10-23.at.19.42.26.mov
iOS: Native
Screen.Recording.2023-10-23.at.19.42.26.1.mov
iOS: mWeb Safari
Screen.Recording.2023-10-23.at.19.43.59.mov
MacOS: Chrome / Safari
Screen.Recording.2023-10-23.at.16.06.33.mov
Recording.5119.mp4
MacOS: Desktop
Screen.Recording.2023-10-23.at.19.36.43.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit