Skip to content

[$250] Search - "is not a valid email address" when starting a DM with phone user via Search #51137

Closed

Description

@IuliiaHerets

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: 9.0.51-1
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): applausetester+kh081006@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Click on the search icon on any report.
  3. Enter a valid phone number.
  4. Click on the search result to initiate a DM with the phone number.

Expected Result:

No error should show up because user should be able to initiate a DM with phone number user via Search.

Actual Result:

App shows "is not a valid email address" when starting a DM with phone user via Search.
Note that user can initiate DM with the same phone number via Start chat in FAB.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6640110_1729410625416.20241020_154305.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021850605811214119295
  • Upwork Job ID: 1850605811214119295
  • Last Price Increase: 2024-10-27
Issue OwnerCurrent Issue Owner: @ikevin127

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 20, 2024
  2. melvin-bot commented on Oct 20, 2024

    @melvin-bot

    Triggered auto assignment to @jasperhuangg (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  3. github-actions commented on Oct 20, 2024

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  4. melvin-bot commented on Oct 20, 2024

    @melvin-bot

    Triggered auto assignment to @lschurr (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  5. melvin-bot commented on Oct 20, 2024

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  6. truph01 commented on Oct 21, 2024

    @truph01
    Contributor

    Edited by proposal-police: This proposal was edited at 2024-10-21 06:21:30 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    App shows "is not a valid email address" when starting a DM with phone user via Search.
    Note that user can initiate DM with the same phone number via Start chat in FAB.

    What is the root cause of that problem?

    • When generating the userToInvite data in new chat page:

    const userToInvite = pickUserToInvite({canInviteUser, recentReports, personalDetails, searchValue, config, optionsToExclude});

    we already have logic to format the search value string if it is phone number:

    const parsedPhoneNumber = PhoneNumber.parsePhoneNumber(LoginUtils.appendCountryCode(Str.removeSMSDomain(searchInputValue)));
    const searchValue = parsedPhoneNumber.possible && parsedPhoneNumber.number?.e164 ? parsedPhoneNumber.number.e164 : searchInputValue.toLowerCase();

    but we don't do it in Search:

    const userToInvite = OptionsListUtils.pickUserToInvite({
    canInviteUser: true,
    recentReports: newOptions.recentReports,
    personalDetails: newOptions.personalDetails,
    searchValue: debouncedInputValue,
    optionsToExclude: [{login: CONST.EMAIL.NOTIFICATIONS}],
    });

    • It leads to, in Search, when starting a DM with phone number, it send the incorrect phone number format to BE, leads to BE throws error.

    What changes do you think we should make in order to solve the problem?

    • We should update it to:
    +      const parsedPhoneNumber = PhoneNumber.parsePhoneNumber(LoginUtils.appendCountryCode(Str.removeSMSDomain(debouncedInputValue)));
    +      const searchValue = parsedPhoneNumber.possible && parsedPhoneNumber.number?.e164 ? parsedPhoneNumber.number.e164 : debouncedInputValue;
            const userToInvite = OptionsListUtils.pickUserToInvite({
                canInviteUser: true,
                recentReports: newOptions.recentReports,
                personalDetails: newOptions.personalDetails,
    +          searchValue: searchValue,
                optionsToExclude: [{login: CONST.EMAIL.NOTIFICATIONS}],
            });

    What alternative solutions did you explore? (Optional)

  7. 289Adam289 commented on Oct 21, 2024

    @289Adam289
    Contributor

    Hi! I cannot reproduce the bug. Can I ask for more reproduction steps?

    Screen.Recording.2024-10-21.at.16.51.32.mp4
  8. truph01 commented on Oct 21, 2024

    @truph01
    Contributor

    @289Adam289 I saw in your video, your searched +15123xxx. Can you try 0123xxx?

  9. 24 remaining items

  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 27, 2024
  11. melvin-bot commented on Oct 27, 2024

    @melvin-bot

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

  12. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 27, 2024
  13. ikevin127 commented on Oct 28, 2024

    @ikevin127
  14. ikevin127 commented on Oct 29, 2024

    @ikevin127
    Contributor

    Same as @289Adam289 and @jasperhuangg, I was not able to reproduce the issue, tried both on Dev (using both dev and staging server) and on Staging with the same phone number as OP video and the behaviour on my side when using 0714637364 phone number is:

    • the new user suggestion doesn't show up
    Screenshot 2024-10-29 at 12 52 02
    • the only error that shows up on my side is if the phone number is not valid, ex. 3234567864, stating:

    Caution

    The provided phone number belongs to a landline or VoIP, please use your email address instead.

    If I use a valid phone number, starting with / without + and country code, say +13237069264, 13237069264 or 3237069264:

    • the new user suggestion shows up and if I click on it the report opens without any errors
    Suggestion Opened Report
    Screenshot 2024-10-29 at 12 52 33 Screenshot 2024-10-29 at 12 52 43

    🔴 I'm not sure what the parameters of @kavimuru reproducing the issue are, but unless we're able to consistently reproduce, I won't be able to move forward reviewing the existing proposal because I won't be able to verify the fix.

  15. melvin-bot commented on Nov 3, 2024

    @melvin-bot

    @puneetlath @jasperhuangg @ikevin127 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

  16. melvin-bot commented on Nov 4, 2024

    @melvin-bot

    @puneetlath, @jasperhuangg, @ikevin127 Eep! 4 days overdue now. Issues have feelings too...

  17. puneetlath commented on Nov 4, 2024

    @puneetlath
    Contributor

    Ok, I think let's just close this for now since no one is able to reproduce.

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.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions