Skip to content

[Due for payment 2025-03-05] [$250] Categories - Default spend categories are missing when workspace is created offline #55994

Closed

Description

@IuliiaHerets

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.0.91-1
Reproducible in staging?: Yes
Reproducible in production?: Yes
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): applausetester+28930@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Windows 11 / Chrome
App Component: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go offline.
  3. Create a new workspace.
  4. Go to workspace settings > Categories.
    5 Click Settings.
  5. Go online.

Expected Result:

In Step 5, Default spend categories will be available when the workspace is created offline.

Actual Result:

In Step 5, Default spend categories are not available when the workspace is created offline.
The categories only appear after returning online.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6727809_1738178830193.bandicam_2025-01-30_03-24-13-528.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021885116611337715784
  • Upwork Job ID: 1885116611337715784
  • Last Price Increase: 2025-01-31
  • Automatic offers:
    • allgandalf | Reviewer | 105971116
    • FitseTLT | Contributor | 105971117
Issue OwnerCurrent Issue Owner: @RachCHopkins

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 29, 2025
  2. melvin-bot commented on Jan 29, 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. FitseTLT commented on Jan 30, 2025

    @FitseTLT
    Contributor

    Proposal

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

    Open Categories - Default spend categories are missing when workspace is created offline

    What is the root cause of that problem?

    We don't set policy.mccGroup optimistically in when creating workspaces so It will only appear after the response of OpenPolicyCategoriesPage API

    key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
    value: {
    id: policyID,
    type: CONST.POLICY.TYPE.TEAM,
    name: workspaceName,
    role: CONST.POLICY.ROLE.ADMIN,
    owner: sessionEmail,

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

    We can set the policy.mccGroup optimistically in buildPolicyData to the value the BE is now setting and also revert it on failureData.
    This is how the data BE is setting looks

                        mccGroup: {
                            airlines: {
                                category: 'Travel',
                                groupID: 'airlines',
                            },
                            commuter: {
                                category: 'Car',
                                groupID: 'commuter',
                            },
                            gas: {
                                category: 'Car',
                                groupID: 'gas',
                            },
                            goods: {
                                category: 'Materials',
                                groupID: 'goods',
                            },
                            groceries: {
                                category: 'Meals and Entertainment',
                                groupID: 'groceries',
                            },
                            hotel: {
                                category: 'Travel',
                                groupID: 'hotel',
                            },
                            mail: {
                                category: 'Office Supplies',
                                groupID: 'mail',
                            },
                            meals: {
                                category: 'Meals and Entertainment',
                                groupID: 'meals',
                            },
                            rental: {
                                category: 'Travel',
                                groupID: 'rental',
                            },
                            services: {
                                category: 'Professional Services',
                                groupID: 'services',
                            },
                            taxi: {
                                category: 'Travel',
                                groupID: 'taxi',
                            },
                            uncategorized: {
                                category: 'Other',
                                groupID: 'uncategorized',
                            },
                            utilities: {
                                category: 'Utilities',
                                groupID: 'utilities',
                            },
                        },
             
    

    we can also set the pendingAction of the mccGroups to ADD and reset it on successData

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

    write a test for buildPolicyData to assert we are setting the mccGroup value optimistically

    What alternative solutions did you explore? (Optional)

  4. RachCHopkins commented on Jan 30, 2025

    @RachCHopkins
    Contributor

    Tested this and it's working normally. Looks like the tester is using the wrong button there.

    1. Go to staging.new.expensify.com
    2. Go offline.
    3. Create a new workspace.
    4. Go to workspace settings > Categories.
    5. Click Settings. - THIS MAIN BUTTON DOESN'T CONTROL EACH CATEGORY'S SETTINGS
    6. Go online.

    You can see in the video that they later correctly tap into the category once they are online again. If they had tapped that at the start, it would have looked exactly the same.

    In my testing, in which I am offline with no wifi or data, not simulated, the categories are all there and all settings are available.

  5. RachCHopkins commented on Jan 31, 2025

    @RachCHopkins
    Contributor

    Reopening this, I've worked out what the tester is trying to describe - the video doesn't exactly reflect what they are describing.

    The issue is that the MCC category defaults are not available offline. In my testing, for one workspace, they also did not return on going online.

    1. Go to staging.new.expensify.com
    2. Go offline.
    3. Create a new workspace.
    4. Go to workspace settings > Categories.
    5. Click Settings. - THIS SHOULD SHOW THE MCC CODE DEFAULTS / "Default Spend Categories"
    6. Go online.
    7. Go back to the main Category list
    8. Go back into the Settings

    Expected results: The defaults should be listed both offline and online

    Result: The defaults will not be listed offline, and may or may not appear when back online

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 31, 2025
  7. changed the title [-]Categories - Default spend categories are missing when workspace is created offline[/-] [+][$250] Categories - Default spend categories are missing when workspace is created offline[/+] on Jan 31, 2025
  8. melvin-bot commented on Jan 31, 2025

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

    @melvin-bot

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

  11. 11 remaining items

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Feb 26, 2025
  13. changed the title [-][$250] Categories - Default spend categories are missing when workspace is created offline[/-] [+][Due for payment 2025-03-05] [$250] Categories - Default spend categories are missing when workspace is created offline[/+] on Feb 26, 2025
  14. melvin-bot commented on Feb 26, 2025

    @melvin-bot

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

  15. melvin-bot commented on Feb 26, 2025

    @melvin-bot

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

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

  16. melvin-bot commented on Feb 26, 2025

    @melvin-bot

    @allgandalf @RachCHopkins @allgandalf 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]

  17. RachCHopkins commented on Mar 5, 2025

    @RachCHopkins
    Contributor

    @allgandalf you wanna do that checklist please?

  18. allgandalf commented on Mar 5, 2025

    @allgandalf
    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: N/A this case was never considered to be implemented

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

    AFTER FILLING THIS OUT, be sure to remove the

    and tags from this part of the checklist!!!!! -->

    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    • N/A

    Test:

    1. Go offline > Create a new workspace.
    2. Go to workspace settings > Categories.
    3. Click Settings.

    Verify Default spend categories are available.

    Do we agree 👍 or 👎

  19. RachCHopkins commented on Mar 7, 2025

    @RachCHopkins
    Contributor

    Payment Summary:

    Upwork job here

  20. RachCHopkins commented on Mar 7, 2025

    @RachCHopkins
    Contributor

    Contributors have been paid, the contracts have been completed, and the Upwork post has been closed.

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