Skip to content

[Due for payment 2025-08-29] [$250] Workspace - Leave button does not response for approver #68355

Closed

Description

@jponikarchuk

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: v9.1.93-0
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: https://test-management.browserstack.com/projects/2219752/test-runs/TR-215/folder/13176872/41237336/835708830
Email or phone of affected tester (no customers): gocemate+b2154072@gmail.com
Issue reported by: Applause Internal Team
Device used: Lenovo 80ES / Windows 10 Pro
App Component: Workspace Settings

Action Performed:

  1. User A create workspace
  2. User A invites User B as approver
  3. User B navigates to workspace> Click on More menu> Leave

Expected Result:

Approver should be able to leave the workspace or there should be an error message that approver can not perform the action

Actual Result:

Leave button does not response

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021955490692804894556
  • Upwork Job ID: 1955490692804894556
  • Last Price Increase: 2025-08-13
  • Automatic offers:
    • nkdengineer | Contributor | 108405181
Issue OwnerCurrent Issue Owner: @RachCHopkins

Activity

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

    @melvin-bot

    Triggered auto assignment to @RachCHopkins (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. nkdengineer commented on Aug 12, 2025

    @nkdengineer
    Contributor

    Proposal

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

    Workspace - Leave button does not response for approver

    What is the root cause of that problem?

    We get this error

    Image

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

    We shouldn't show the leave button when the user is default approver by using getDefaultApprover in PolicyUtils

                const defaultApprover = getDefaultApprover(getPolicy(item.policyID)); // we can use another way to get policy here
                if (!(isAdmin || isOwner) && defaultApprover !== session?.email) {
                    threeDotsMenuItems.push({
                        icon: Expensicons.Exit,
                        text: translate('common.leave'),
                        onSelected: callFunctionIfActionIsAllowed(() => leaveWorkspace(item.policyID)),
                    });
                }
    

    if (!(isAdmin || isOwner)) {
    threeDotsMenuItems.push({
    icon: Expensicons.Exit,
    text: translate('common.leave'),
    onSelected: callFunctionIfActionIsAllowed(() => leaveWorkspace(item.policyID)),
    });
    }

    Note: we can check other leave button

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

None

    What alternative solutions did you explore? (Optional)

    Or we can still show the leave button and will alert if the default approver click to this button

  4. RachCHopkins commented on Aug 13, 2025

    @RachCHopkins
    Contributor

    I don't think these repro steps are correct:

    User A invites User B as approver

    The only roles available are Admin, Auditor or Member

    Image

    Going by the video included the actual repro steps are:

    1. User A create workspace
    2. User A invites User B as Member
    3. User A goes to Workflows > Add approvals > set Approver to be User B
    4. User B navigates to workspaces page > click 3 dots > Leave

    Expected Result:
    Approver should be able to leave the workspace or there should be an error message that approver can not perform the action

    Actual Result:
    The workspace disappears briefly and then reappears.

    There is actually a log line in the background:

    errors: '[1755059151980000: 'There was a problem removing that workspace member']

    I'm not sure how thoroughly this was tested, because it's not just mWeb Chrome and Windows: Chrome

    • Android: App
    • Android: mWeb Chrome
    • iOS: App
    • iOS: mWeb Safari
    • iOS: mWeb Chrome
    • Windows: Chrome
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 13, 2025
  6. changed the title [-]Workspace - Leave button does not response for approver[/-] [+][$250] Workspace - Leave button does not response for approver[/+] on Aug 13, 2025
  7. melvin-bot commented on Aug 13, 2025

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

    @melvin-bot

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

  10. nikolai-git-house commented on Aug 13, 2025

    @nikolai-git-house

    Proposal

    Problem:
    When an approver in a workspace clicks Leave in the workspace settings, nothing happens — there’s no success action and no error message. This makes it unclear whether leaving is allowed and prevents the user from taking action or understanding the restriction.

    Steps to Reproduce:

    1. User A creates a workspace.
    2. User A invites User B as an approver.
    3. User B navigates to:
      Workspace → More menu → Leave.
    4. Click Leave.
    5. Observe no response.

    Expected Result:
    If approvers are allowed to leave: the workspace should be removed from their list and confirmation should be shown.
    If approvers are not allowed to leave: display an error message clearly stating the restriction.

    Actual Result:
    The Leave button is non-responsive — no visual feedback, no action taken.

    Proposed Solution:

    • Ensure the Leave button for approvers triggers the onLeaveWorkspace handler and sends the request to the backend.
    • If the backend rejects the request (e.g., approver role restriction), display a visible error toast (e.g., “Approvers must be removed from their role before leaving this workspace”).
    • Optionally disable the button with a tooltip if leaving is disallowed, to prevent confusion.
  11. melvin-bot commented on Aug 13, 2025

    @melvin-bot

    📣 @nikolai-git-house! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  12. melvin-bot commented on Aug 13, 2025

    @melvin-bot

    ⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.

  13. 9 remaining items

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Aug 22, 2025
  15. changed the title [-][$250] Workspace - Leave button does not response for approver[/-] [+][Due for payment 2025-08-29] [$250] Workspace - Leave button does not response for approver[/+] on Aug 22, 2025
  16. melvin-bot commented on Aug 22, 2025

    @melvin-bot

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

  17. melvin-bot commented on Aug 22, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.97-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 2025-08-29. 🎊

    For reference, here are some details about the assignees on this issue:

  18. melvin-bot commented on Aug 22, 2025

    @melvin-bot

    @dukenv0307 @RachCHopkins The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  19. dukenv0307 commented on Aug 25, 2025

    @dukenv0307
    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: https://github.com/Expensify/App/pull/35671/files#r2297670121

    • [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: N/A

    • [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. Yes

    Regression Test Proposal Template

    Regression Test Proposal

    Test:

    1. User A create workspace
    2. User A invites User B
    3. User A goes to Workflows > Add approvals > set the default Approver to be User B
    4. User B navigates to workspace> Click on More menu
    5. Verify that: Leave option is not displayed

    Do we agree 👍 or 👎

  20. RachCHopkins commented on Aug 27, 2025

    @RachCHopkins
    Contributor

    Payment Summary:

    • Contributor: @nkdengineer to be paid $250 via Upwork
    • Contributor+: @dukenv0307 to be paid $250 via NewDot Manual Request

    Upwork job here

  21. RachCHopkins commented on Aug 29, 2025

    @RachCHopkins
    Contributor

    Contributor has been paid, the contract has been completed, and the Upwork post has been closed.

    @dukenv0307 🟢 to request payment.

  22. quinthar commented on Sep 15, 2025

    @quinthar
    Contributor

    Approved $250 to @dukenv0307

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