Skip to content

[$250] [HOLD for payment 2024-10-10] Categories - Spend category field is not grayed out after changing category offline #48678

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
6 tasks done
IuliiaHerets opened this issue Sep 6, 2024 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 6, 2024

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: 9.0.30-4
Reproducible in staging?: Y
Reproducible in production?: N
Issue was found when executing this PR: #48391
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Categories.
  3. Click Settings.
  4. Go offline.
  5. Click on any spend categories.
  6. Change the category.

Expected Result:

The spend category field will be grayed out after changing category offline.

Actual Result:

The spend category field is not grayed out after changing category offline.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6594735_1725578843379.20240906_072521.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021844768877300090073
  • Upwork Job ID: 1844768877300090073
  • Last Price Increase: 2024-10-11
Issue OwnerCurrent Issue Owner: @
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 6, 2024
Copy link

melvin-bot bot commented Sep 6, 2024

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

Copy link

melvin-bot bot commented Sep 6, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Sep 6, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 6, 2024
Copy link
Contributor

github-actions bot commented Sep 6, 2024

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

@nyomanjyotisa
Copy link
Contributor

Proposal

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

Spend category field is not grayed out after changing category offline

What is the root cause of that problem?

We don't handle the update pendingAction yet, here

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

set the pendingAction update on optimistic data and revert back on failure data and on success data here

const optimisticData: OnyxUpdate[] = mccGroup
        ? [
              {
                onyxMethod: Onyx.METHOD.MERGE,
                key: `policy_${policyID}`,
                value: {
                    mccGroup: {
                        [groupID]: {
                            category,
                            groupID,
                            pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
                        },
                    },
                },
              },
          ]
        : [];

    const failureData: OnyxUpdate[] = mccGroup
        ? [
              {
                  onyxMethod: Onyx.METHOD.MERGE,
                  key: `policy_${policyID}`,
                  value: {
                    mccGroup: {
                        [groupID]: {
                            pendingAction: null,
                        },
                    },
                  },
              },
          ]
        : [];
    
    const successData: OnyxUpdate[] = mccGroup
        ? [
              {
                  onyxMethod: Onyx.METHOD.MERGE,
                  key: `policy_${policyID}`,
                  value: {
                    mccGroup: {
                        [groupID]: {
                            pendingAction: null,
                        },
                    },
                  },
              },
          ]
        : [];

Add pendingAction here

data: Object.entries(currentPolicy.mccGroup).map(
        ([mccKey, mccGroup]) =>
            ({
                categoryID: mccGroup.category,
                keyForList: mccKey,
                groupID: mccKey,
                policyID,
                tabIndex: -1,
                pendingAction: mccGroup.pendingAction
            } as ListItem),
    ),

And pass pendingAction here to greyed out the item

        <BaseListItem
            item={item}
            wrapperStyle={[isFocused && styles.sidebarLinkActive]}
            pressableStyle={[styles.mt2]}
            onSelectRow={onSelect}
            isFocused={isFocused}
            showTooltip
            keyForList={item.keyForList}
            pendingAction={item.pendingAction}
        >

RESULT
image

What alternative solutions did you explore? (Optional)

@miljakljajic
Copy link
Contributor

I don't think this is a blocker - @iwiznia and also @roryabraham you're on deploy duty, what do you think?

@iwiznia
Copy link
Contributor

iwiznia commented Sep 6, 2024

I think it is, given it comes from the regression testing and it is happening on staging but not prod

@iwiznia
Copy link
Contributor

iwiznia commented Sep 6, 2024

Hmmmm weird, isn't this a new feature?

@iwiznia
Copy link
Contributor

iwiznia commented Sep 6, 2024

It is. It's quite confusing that this says Reproducible in production?: N (posted about this here https://expensify.slack.com/archives/C9YU7BX5M/p1725622657080389)

@iwiznia iwiznia removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Sep 6, 2024
@iwiznia
Copy link
Contributor

iwiznia commented Sep 6, 2024

This is a new feature added in #48391 by @BartoszGrajdek, so it's probably best that they take this issue. Is that ok @BartoszGrajdek?

@BartoszGrajdek
Copy link
Contributor

Yes that's ok, I'll work on it as a follow-up next week 😄

@miljakljajic
Copy link
Contributor

I am unassigning for my parental leave - given this is being managed by @BartoszGrajdek I don't think we need to assign another BZ team member, but if I am wrong, go ahead and do that @iwiznia

@miljakljajic miljakljajic removed their assignment Sep 20, 2024
Copy link

melvin-bot bot commented Sep 20, 2024

@iwiznia @BartoszGrajdek this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review and removed Monthly KSv2 labels Sep 23, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

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

Copy link

melvin-bot bot commented Oct 3, 2024

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

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

Copy link

melvin-bot bot commented Oct 3, 2024

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@iwiznia] The PR that introduced the bug has been identified. Link to the PR:
  • [@iwiznia] 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:
  • [@iwiznia] A discussion in #expensify-bugs 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:
  • [@BartoszGrajdek] Determine if we should create a regression test for this bug.
  • [@BartoszGrajdek] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 9, 2024
Copy link

melvin-bot bot commented Oct 10, 2024

Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

@mallenexpensify mallenexpensify removed the Bug Something is broken. Auto assigns a BugZero manager. label Oct 11, 2024
@mallenexpensify mallenexpensify added Internal Requires API changes or must be handled by Expensify staff Bug Something is broken. Auto assigns a BugZero manager. labels Oct 11, 2024
Copy link

melvin-bot bot commented Oct 11, 2024

Current assignee @mallenexpensify is eligible for the Bug assigner, not assigning anyone new.

@mallenexpensify mallenexpensify added External Added to denote the issue can be worked on by a contributor and removed Internal Requires API changes or must be handled by Expensify staff labels Oct 11, 2024
Copy link

melvin-bot bot commented Oct 11, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021844768877300090073

@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-10-10] Categories - Spend category field is not grayed out after changing category offline [$250] [HOLD for payment 2024-10-10] Categories - Spend category field is not grayed out after changing category offline Oct 11, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 11, 2024
Copy link

melvin-bot bot commented Oct 11, 2024

Current assignee @akinwale is eligible for the External assigner, not assigning anyone new.

@mallenexpensify mallenexpensify removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 11, 2024
@mallenexpensify
Copy link
Contributor

@akinwale can you please accept the job and reply here once you have?
https://www.upwork.com/jobs/~021844768877300090073

@akinwale
Copy link
Contributor

@mallenexpensify Offer accepted. Thanks!

@mallenexpensify
Copy link
Contributor

Contributor+: @akinwale paid $250 via Upwork

@akinwale plz complete the BZ checklist above

@akinwale
Copy link
Contributor

  • [@akinwale] The PR that introduced the bug has been identified. Link to the PR:
  • [@akinwale] 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:
  • [@akinwale] A discussion in #expensify-bugs 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 a regression.

  • [@akinwale] Determine if we should create a regression test for this bug.
  • [@akinwale] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

Regression Test Steps
Prerequisites

  1. Create a new workspace
  2. Navigate to Workspace Settings > More features > Organize
  3. Enable the Categories setting
  4. Have the canUseWorkspaceRules beta enabled

Test Steps

  1. Launch Expensify
  2. Navigate to the workspace settings > Categories.
  3. Click Settings.
  4. Go offline.
  5. Click on any of the spend categories.
  6. Change the category.
  7. Verify that the spend category field is grayed out after changing the category offline.

Do we agree 👍 or 👎?

@melvin-bot melvin-bot bot added the Overdue label Oct 14, 2024
Copy link

melvin-bot bot commented Oct 14, 2024

@iwiznia, @akinwale, @mallenexpensify, @BartoszGrajdek Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@akinwale
Copy link
Contributor

@mallenexpensify BZ checklist completed.

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2024
@mallenexpensify
Copy link
Contributor

Thanks @akinwale , test case created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
No open projects
Status: Done
Development

No branches or pull requests

7 participants