Skip to content

[Due for payment 2025-04-23] [$250] Co-pilot is able to delete a contact method #59093

Closed

Description

@m-natarajan

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.1.18-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
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: @allgandalf
Slack conversation (hyperlinked to channel name): #Expensify-bugs

Action Performed:

Precondition

  • Have a account atleast one extra contact method added and verified
  1. Co-pilot login into that account
  2. Go to profile > Contacts > The extra added contact
  3. Click on delete contact

Expected Result:

We should see a modal explainig that these actions cannot be performed by a delegate like we do when adding a contact method

Actual Result:

Co-pilot is able to delete the contact method of another users account

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence
Recording.1083.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021904822580033366895
  • Upwork Job ID: 1904822580033366895
  • Last Price Increase: 2025-04-09
  • Automatic offers:
    • allgandalf | Contributor | 106854149
Issue OwnerCurrent Issue Owner: @bfitzexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 25, 2025
  2. melvin-bot commented on Mar 25, 2025

    @melvin-bot

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

  3. m-natarajan commented on Mar 25, 2025

    @m-natarajan
    Author

    Proposal by @allgandalf

    Proposal

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

    Co-pilot is able to delete a contact method

    What is the root cause of that problem?

    We block the co-pilot from adding a new contact method, but we don't block them deleting an added contact method:

    if (isActingAsDelegate) {
    setIsNoDelegateAccessMenuVisible(true);
    return;
    }

    */
    const confirmDeleteAndHideModal = useCallback(() => {
    toggleDeleteModal(false);
    deleteContactMethod(contactMethod, loginList ?? {}, backTo);
    }, [contactMethod, loginList, toggleDeleteModal, backTo]);

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

    We should check if isActingAsDelegate is true and show the noAccess delegate modal to the user. same as we did in ContactMethodsPage.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    N/A but if we want then, we can render the contacts detail page have the account logged in as delegate then press the delete button and verify that we see no access modal

    What alternative solutions did you explore? (Optional)

    • We can hide the delete button altogether
    • In ContactMethodsPage, we will not show the right icon and not navigate when clicked

    But i guess the main solution is the best as we follow the same approach throughout the application

  4. moved this to Bugs and Follow Up Issues in #expensify-bugson Mar 26, 2025
  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Mar 26, 2025
  6. changed the title [-]Co-pilot is able to delete a contact method[/-] [+][$250] Co-pilot is able to delete a contact method[/+] on Mar 26, 2025
  7. melvin-bot commented on Mar 26, 2025

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 26, 2025
  9. melvin-bot commented on Mar 26, 2025

    @melvin-bot

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

  10. melvin-bot commented on Mar 31, 2025

    @melvin-bot

    @rojiphil Eep! 4 days overdue now. Issues have feelings too...

  11. 48 remaining items

  12. abekkala commented on Apr 23, 2025

    @abekkala
    Contributor

    @rojiphil can you complete the checklist please?

    @allgandalf payment sent and contract ended - thank you! 🎉

  13. rojiphil commented on Apr 25, 2025

    @rojiphil
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: Not Required. The existing checklist is good enough to capture such issues.

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Precondition:

    Have an account atleast one extra contact method added and verified

    Test:

    1. Co-pilot login into that account
    2. Go to profile > Contacts > The extra added contact
    3. Click on delete contact
    4. Verify that we see a modal explaining that these actions cannot be performed by a delegate like we do when adding a contact method

    Do we agree 👍 or 👎

  14. rojiphil commented on Apr 25, 2025

    @rojiphil
    Contributor

    @abekkala BZ Checklist done. Thanks.

  15. allgandalf commented on Apr 28, 2025

    @allgandalf
    Contributor

    lets close this

  16. melvin-bot commented on Apr 28, 2025

    @melvin-bot

    @bfitzexpensify Huh... This is 4 days overdue. Who can take care of this?

  17. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Apr 28, 2025
  18. garrettmknight commented on May 2, 2025

    @garrettmknight
    Contributor

    $250 approved for @rojiphil

  19. garrettmknight commented on May 2, 2025

    @garrettmknight
    Contributor

    Reopening for @bfitzexpensify to finish the QA test.

  20. abekkala commented on May 2, 2025

    @abekkala
    Contributor

    QA test GH created https://github.com/Expensify/Expensify/issues/497011
    I didn't realize it was posted above and then missed that this was closed while Ben was ooo

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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions