Skip to content

Expense - Change Workspace option available for submitted expense #59890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
5 of 8 tasks
IuliiaHerets opened this issue Apr 9, 2025 · 16 comments
Closed
5 of 8 tasks

Expense - Change Workspace option available for submitted expense #59890

IuliiaHerets opened this issue Apr 9, 2025 · 16 comments
Assignees

Comments

@IuliiaHerets
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: v9.1.25-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5901011
Issue reported by: Applause Internal Team
Device used: Windows 10 / Chrome
App Component: Workspace Settings

Action Performed:

Precondition: Employee has 2 workspaces

  1. Open the First WS with 2 expenses in submitted and submit status
  2. Click on the More button on the expense in the Submitted status
  3. Click on the Change Workspace
  4. Change the submitted expense to the second workspace
  5. Click on the More button on the expense in the Submit status
  6. Click on the Change Workspace
  7. Select the second workspace

Expected Result:

The change workspace option only displays for an expense in the Submit status

Actual Result:

The change workspace option display for a submitted expense and after click on it display an error message

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6796887_1744185652889.Change_WS.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added Daily KSv2 DeployBlockerCash This issue or pull request should block deployment labels Apr 9, 2025
Copy link

melvin-bot bot commented Apr 9, 2025

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

Copy link

melvin-bot bot commented Apr 9, 2025

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Apr 9, 2025
Copy link
Contributor

github-actions bot commented Apr 9, 2025

👋 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.

@grgia
Copy link
Contributor

grgia commented Apr 9, 2025

Potential RCA: #58084

@jnowakow
Copy link
Contributor

jnowakow commented Apr 9, 2025

According to design doc it's correct behaviour. I've asked it here https://docs.google.com/document/d/1JZLr_5gX348cMZXNr6HUwi4QscOcDg3IY368FMAu3H4/edit?disco=AAABgi2j1Cc
cc @luacmartins

@ChavdaSachin
Copy link
Contributor

Proposal

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

Change Workspace option available for submitted expense

What is the root cause of that problem?

RCA for this issue is, whether change workspace option should be visible or not is determined from ReportSecondaryActionUtils.isChangeWorkspaceAction function.
In which change workspace is made visible even when report is processing ie. submitted/approved but not paid yet.

const isProcessingReport = isProcessingReportUtils(report);
if (isReportSubmitter && (isOpenReport || isProcessingReport)) {
return true;
}

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

Remove isProcessingReport and isReportApproved checks here and only show change workspace option for open or closed reports.

    const isOpenReport = isOpenReportUtils(report);

    if (isReportSubmitter && isOpenReport) {
        return true;
    }

    const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
    const isReportPayer = isPayerUtils(getSession(), report, false, policy);

    if (isReportPayer && isClosedReport) {
        return true;
    }

const isOpenReport = isOpenReportUtils(report);
const isProcessingReport = isProcessingReportUtils(report);
if (isReportSubmitter && (isOpenReport || isProcessingReport)) {
return true;
}
const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID());
if (isReportApprover && isProcessingReport) {
return true;
}
const isReportPayer = isPayerUtils(getSession(), report, false, policy);
const isReportApproved = isReportApprovedUtils({report});
if (isReportPayer && (isReportApproved || isClosedReport)) {
return true;
}

Also remove isReportApproved check here.

const isReportFinished = isReportApproved || isReportReimbursed || isClosedReport;

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

NA

What alternative solutions did you explore? (Optional)

NA

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Apr 9, 2025
Copy link

melvin-bot bot commented Apr 9, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented Apr 9, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

Copy link

melvin-bot bot commented Apr 9, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Apr 9, 2025
@luacmartins
Copy link
Contributor

FYI we reverted the original offending PR

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Apr 9, 2025
Copy link

melvin-bot bot commented Apr 9, 2025

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@luacmartins luacmartins self-assigned this Apr 9, 2025
@luacmartins
Copy link
Contributor

This is expected. Users can change the workspace on a report up until the report has one level of approval on it.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 11, 2025
@melvin-bot melvin-bot bot changed the title Expense - Change Workspace option available for submitted expense [Due for payment 2025-04-18] Expense - Change Workspace option available for submitted expense Apr 11, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 11, 2025
Copy link

melvin-bot bot commented Apr 11, 2025

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

Copy link

melvin-bot bot commented Apr 11, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.26-10 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-04-18. 🎊

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Apr 15, 2025
@luacmartins luacmartins assigned jnowakow and borys3kk and unassigned grgia Apr 25, 2025
@luacmartins luacmartins removed Reviewing Has a PR in review Awaiting Payment Auto-added when associated PR is deployed to production labels Apr 25, 2025
@luacmartins luacmartins changed the title [Due for payment 2025-04-18] Expense - Change Workspace option available for submitted expense Expense - Change Workspace option available for submitted expense Apr 25, 2025
@luacmartins
Copy link
Contributor

I'm gonna reopen this since it's still happening. I'm seeing a 401 Not allowed to set this magic reportNameValuePair error in the API. I'll take a look at it.

@luacmartins
Copy link
Contributor

I'm unable to reproduce this. Closing.

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

No branches or pull requests

6 participants