Skip to content

[HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Prevent requesting money from domain emails #44429

Closed

Description

@techievivek

Domain emails are in format +@<domain> like +@expensify.com.

Problem

We allow users to request money from domains in newDot. Update the code so we don't allow this action.

Screenshot 2024-06-26 at 1 10 52 PM Screenshot 2024-06-26 at 1 09 48 PM

Steps to reproduce:

  1. From the global create button, select Split expense.
  2. In the search field enter +@applause.expensifail.com' and confirm you are able to select that email as an option.

Solution

Update the code to prevent users from requesting money from domain emails.

Solution

Update the code to prevent users from requesting money from domain emails.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014e28879d82637e16
  • Upwork Job ID: 1805872485147678962
  • Last Price Increase: 2024-06-26
  • Automatic offers:
    • rayane-djouah | Reviewer | 102895687
    • nkdengineer | Contributor | 102895688
Issue OwnerCurrent Issue Owner: @isabelastisser

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    Help WantedApply this label when an issue is open to proposals by contributors
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 26, 2024
  2. self-assigned this
    on Jun 26, 2024
  3. melvin-bot commented on Jun 26, 2024

    @melvin-bot
  4. changed the title [-]Prevent requesting money from domain emails[/-] [+][$250] Prevent requesting money from domain emails[/+] on Jun 26, 2024
  5. melvin-bot commented on Jun 26, 2024

    @melvin-bot

    Triggered auto assignment to @isabelastisser (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.

  6. melvin-bot commented on Jun 26, 2024

    @melvin-bot

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

  7. nkdengineer commented on Jun 26, 2024

    @nkdengineer
    Contributor

    Proposal

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

    We'd like to prevent requesting money from domain emails

    What is the root cause of that problem?

    There's no logic to exclude domain emails when getOptions

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

    Add a param includeDomainEmail to getOptions

    includeCategories = false,
    , default to true

    In

    const havingLoginPersonalDetails = includeP2P ? options.personalDetails.filter((detail) => !!detail?.login && !!detail.accountID && !detail?.isOptimisticPersonalDetail) : [];
    , add

    && (includeDomainEmail || !Str.isDomainEmail(detail.login))
    

    [Optional] In


    add

    if (Str.isDomainEmail(login) && !includeDomainEmail) {
        return;
    }
    

    In the money request participants page, pass includeDomainEmail as false

    Can include the same check in other places in getOptions if needed

    What alternative solutions did you explore? (Optional)

    includeDomainEmail=false can be used for other use cases that should not include the domain email. We can also default includeDomainEmail to false if we don't want to show this when getting options by default.

    We can optionally update the message when not found to "You cannot submit expense to a domain email". It's clearer than "No results found" that's being shown to the user.

  8. rayane-d commented on Jun 26, 2024

    @rayane-d
    Contributor

    @nkdengineer's proposal looks good to me.

    🎀👀🎀 C+ reviewed

  9. melvin-bot commented on Jun 26, 2024

    @melvin-bot

    Current assignee @techievivek is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

  10. rayane-d commented on Jun 26, 2024

    @rayane-d
    Contributor

    @techievivek - To confirm, Do we need to exclude domain email options in all IOU flows: Submit Expense, Split Expense, Pay Someone, Send Invoice? Do we also need to exclude them in the Start chat and assign task flows?

    Edit: based on this issue #44485, we need to exclude the domain email option for the Start chat flow. So, I think all flows should be considered.

  11. 34 remaining items

  12. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 18, 2024
  13. melvin-bot commented on Jul 18, 2024

    @melvin-bot

    Triggered auto assignment to @adelekennedy (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.

  14. isabelastisser commented on Jul 18, 2024

    @isabelastisser
    Contributor

    I will be OOO tomorrow and next week, so I am reassigning this until I return on July 29. Thanks, @adelekennedy!

    Status:

  15. rayane-d commented on Jul 20, 2024

    @rayane-d
    Contributor
    • The PR that introduced the bug has been identified. Link to the PR: No PR caused this, as this introduces a new feature. Previously, there was no logic to exclude domain emails.
    • 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: N/A
    • 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: N/A
    • Determine if we should create a regression test for this bug. Yes
    • 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.

    Regression Test Proposal

    1. From the global create button, select one of the flows: Submit Expense, Split Expense, Pay Someone, Send Invoice, Start chat, or assign task...
    2. In the "Name, email, or phone number" field enter a domain email in this format: +@<domain>, like +@applause.expensifail.com.
    3. Verify that you aren't able to select the domain email as an option.

    Do we agree 👍 or 👎

  16. techievivek commented on Jul 22, 2024

    @techievivek
    ContributorAuthor

    The regression test looks good to me; @adelekennedy, can we please get that added? Thanks.

  17. techievivek commented on Jul 22, 2024

    @techievivek
    ContributorAuthor

    Not overdue, completing the BZ list.

  18. melvin-bot commented on Jul 22, 2024

    @melvin-bot

    @isabelastisser, @techievivek, @adelekennedy, @rayane-djouah, @nkdengineer Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  19. isabelastisser commented on Jul 29, 2024

    @isabelastisser
    Contributor

    Thanks, @adelekennedy !

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded 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