Skip to content

[$500] Room - Can invite valid phone account multiple times into the room #30190

Description

@kbecciv

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:

  1. Create a WS
  2. Create a room with workspace
  3. Click room header => Members => Invite
  4. Input an invalid phone (eg: +3233232432) then select and click invite
  5. Repeat step 4

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?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

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
  • Upwork Job URL: https://www.upwork.com/jobs/~01da7f12cf9ed3d23f
  • Upwork Job ID: 1716509714359189504
  • Last Price Increase: 2023-10-30
  • Automatic offers:
    • DylanDylann | Contributor | 27539247
    • namhihi237 | Reporter | 27539248

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 23, 2023
  2. melvin-bot commented on Oct 23, 2023

    @melvin-bot

    Triggered auto assignment to @greg-schroeder (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. 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
  4. melvin-bot commented on Oct 23, 2023

    @melvin-bot
  5. melvin-bot commented on Oct 23, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in 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
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 23, 2023
  7. melvin-bot commented on Oct 23, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)

  8. alitoshmatov commented on Oct 23, 2023

    @alitoshmatov
    Contributor

    I think number provided number(+3233232432) is valid number

  9. namhihi237 commented on Oct 23, 2023

    @namhihi237
    Contributor

    @alitoshmatov you can try with a new chat. the backend return invalid

  10. namhihi237 commented on Oct 23, 2023

    @namhihi237
    Contributor

    I think issue should fixed in backend.

  11. FitseTLT commented on Oct 23, 2023

    @FitseTLT
    Contributor

    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

    !_.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 the addSMSDomainIfPhoneNumber function which concatinates '@expensify.sms' to the searchInput. 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

    !_.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()) &&
    
  12. 72 remaining items

  13. 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
  14. melvin-bot commented on Jan 31, 2024

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  15. melvin-bot commented on Jan 31, 2024

    @melvin-bot

    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:

  16. melvin-bot commented on Jan 31, 2024

    @melvin-bot

    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:
  17. Beamanator commented on Jan 31, 2024

    @Beamanator
    Contributor

    Seems like the PR for this was reverted again 😬 #35335 so no payment due yet

  18. greg-schroeder commented on Feb 6, 2024

    @greg-schroeder
    Contributor

    RIP

  19. 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
  20. greg-schroeder commented on Feb 6, 2024

    @greg-schroeder
    Contributor

    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

  21. DylanDylann commented on Feb 6, 2024

    @DylanDylann
    Contributor

    @rushatgabhane @mountiny I cannot reproduce this issue in staging anymore. Can anyone help confirm?

  22. added
    retest-weeklyApply this label if you want this issue tested on a Weekly basis by Applause
    on Feb 13, 2024
  23. Beamanator commented on Feb 13, 2024

    @Beamanator
    Contributor

    Added retest-weekly to get more eyes from applause, would be great if this got fixed automagically somehow 😅 😳

  24. greg-schroeder commented on Feb 16, 2024

    @greg-schroeder
    Contributor

    I 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2retest-weeklyApply this label if you want this issue tested on a Weekly basis by Applause

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions