Skip to content

[Due for payment 2025-05-20] [$250] Error in archived task "Set up categories" when disabling category in another workspace #61006

Closed

Description

@mitarachim

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.33-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: Exp
Email or phone of affected tester (no customers): sdjiosnjosjosjd@gmail.com
Issue reported by: Applause Internal Team
Device used: Mac 15.3 / Chrome
App Component: Other

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log in with a new Gmail account (don't use + account).
  3. Click Skip on work email step.
  4. Select Manage my team's expenses.
  5. Select 1-10 employees > Continue.
  6. Select any accounting software > Continue.
  7. Go to Account > Workspaces.
  8. Delete the workspace.
  9. Create a new workspace.
  10. Go to workspace settings > Categories.
  11. Disable any category.
  12. Note that there is task complete sound in the background after disabling the category.
  13. Go back to Inbox.
  14. Open the task report "Set up categories".

Expected Result:

The task report "Set up categories" should not be marked when the original workspace is deleted and category in another workspace is disabled.

Actual Result:

The task report "Set up categories" is marked when the original workspace is deleted and category in another workspace is disabled.
As a result, the task report shows the error "You don't have permission to take the requested action" because the task report is archived.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6815851_1745890407417.20250429_092511.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021917138863048883245
  • Upwork Job ID: 1917138863048883245
  • Last Price Increase: 2025-04-29
  • Automatic offers:
    • truph01 | Contributor | 107183854
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @kadiealexander

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    DeployBlockerIndicates it should block deploying the API
    DeployBlockerCashThis issue or pull request should block deployment
    on Apr 29, 2025
  2. melvin-bot commented on Apr 29, 2025

    @melvin-bot

    Triggered auto assignment to @kadiealexander (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. melvin-bot commented on Apr 29, 2025

    @melvin-bot

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

  4. melvin-bot commented on Apr 29, 2025

    @melvin-bot

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

  5. github-actions commented on Apr 29, 2025

    @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.
  6. samranahm commented on Apr 29, 2025

    @samranahm
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-04-29 04:33:46 UTC.

    Proposal

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

    Error in archived task "Set up categories" when disabling category in another workspace

    What is the root cause of that problem?

    This happen when we try to complete an onboarding task when we disable a category but we actually not checking if the report has been archived/ onboarding workspace has been deleted here

    App/src/libs/actions/Task.ts

    Lines 1281 to 1283 in bd0f3f2

    if (taskReport) {
    if (taskReport.stateNum !== CONST.REPORT.STATE_NUM.APPROVED || taskReport.statusNum !== CONST.REPORT.STATUS_NUM.APPROVED) {
    return completeTask(taskReport);

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

    We should add isArchivedReportWithID here

      if (!ReportUtils.isArchivedReportWithID(taskReport?.reportID) && (taskReport.stateNum !== CONST.REPORT.STATE_NUM.APPROVED || taskReport.statusNum !== CONST.REPORT.STATUS_NUM.APPROVED)) {

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

    N/A

    What alternative solutions did you explore? (Optional)

    We can check if the category belong to same workspace/ onboarding workspace, before calling completeTask

    here

    App/src/libs/actions/Task.ts

    Lines 1282 to 1284 in bd0f3f2

    if (taskReport.stateNum !== CONST.REPORT.STATE_NUM.APPROVED || taskReport.statusNum !== CONST.REPORT.STATUS_NUM.APPROVED) {
    return completeTask(taskReport);
    }

  7. 32 remaining items

  8. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on May 13, 2025
  9. changed the title [-][$250] Error in archived task "Set up categories" when disabling category in another workspace[/-] [+][Due for payment 2025-05-20] [$250] Error in archived task "Set up categories" when disabling category in another workspace[/+] on May 13, 2025
  10. melvin-bot commented on May 13, 2025

    @melvin-bot

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

  11. melvin-bot commented on May 13, 2025

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.44-8 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-05-20. 🎊

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

  12. melvin-bot commented on May 13, 2025

    @melvin-bot

    @hungvu193 @kadiealexander @hungvu193 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]

  13. kadiealexander commented on May 21, 2025

    @kadiealexander
    Contributor

    Payments needed:

    @hungvu193 please complete the checklist!

  14. hungvu193 commented on May 21, 2025

    @hungvu193
    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 (eg. bug slipped through the normal regression and PR testing process on staging)
    • 2b. Reported on staging (eg. found during regression or PR testing)
    • 2d. 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/60608/files#r2099600075

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

    https://github.com/Expensify/Expensify/issues/503657

    Regression Test Proposal

    Test:

    1. Go to staging.new.expensify.com
    2. Log in with a new Gmail account (don't use + account).
    3. Click Skip on work email step.
    4. Select Manage my team's expenses.
    5. Select 1-10 employees > Continue.
    6. Select any accounting software > Continue.
    7. Go to Account > Workspaces.
    8. Delete the workspace.
    9. Create a new workspace.
    10. Go to workspace settings > Categories.
    11. Disable any category.
    12. Note that there is task complete sound in the background after disabling the category.
    13. Go back to Inbox.
    14. Open the #admin room of the workspace that you've just deleted.
    15. Verify that Set up categories task is archived and not marked as completed.

    Do we agree 👍 or 👎

  15. kadiealexander commented on May 22, 2025

    @kadiealexander
    Contributor

    Payment summary here.

  16. garrettmknight commented on Jun 3, 2025

    @garrettmknight
    Contributor

    $250 approved for @hungvu193

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