Skip to content
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

[HOLD for payment 2024-03-20] [$500][MEDIUM] Categories: Parent that has own category is not ticked in All list when selected #37326

Closed
6 tasks done
lanitochka17 opened this issue Feb 27, 2024 · 44 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

@lanitochka17
Copy link

lanitochka17 commented Feb 27, 2024

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: 1.4.44-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

Precondition:

  • User is an employee of Collect workspace
  • The Collect workspace has these categories:
  • Test
  • Test: Test 1
  • Test: Test 2
  1. Go to staging.new.expensify.com
  2. Go to workspace chat
  3. Click + > Request money > Manual
  4. Enter amount and proceed to confirmation page
  5. Click Show more
  6. Click Category
  7. Select the parent category "Test"
  8. Click Category
  9. Scroll down to find the parent category "Test"

Expected Result:

The parent category "Test" will be displayed with a tick in the list (production behavior) because it is selected

Actual Result:

The parent category "Test" is not displayed with a tick in the list

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6394349_1709055194859.20240227-135357_a31RC8Aq.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010569839356f2354c
  • Upwork Job ID: 1762533897677324288
  • Last Price Increase: 2024-02-27
  • Automatic offers:
    • hoangzinh | Reviewer | 0
    • dukenv0307 | Contributor | 0
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment External Added to denote the issue can be worked on by a contributor labels Feb 27, 2024
@melvin-bot melvin-bot bot changed the title Category - Parent that has own category is not ticked in All list when selected [$500] Category - Parent that has own category is not ticked in All list when selected Feb 27, 2024
Copy link

melvin-bot bot commented Feb 27, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 27, 2024
Copy link

melvin-bot bot commented Feb 27, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Feb 27, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Feb 27, 2024
Copy link
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.

Copy link

melvin-bot bot commented Feb 27, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave6
CC @greg-schroeder

@hoangzinh
Copy link
Contributor

hoangzinh commented Feb 27, 2024

I think it's not a DB, just an edge case displaying. User is still able to select another category

@blimpich
Copy link
Contributor

Agreed, demoting. Will handle this with the regular bug process.

@blimpich blimpich added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Feb 27, 2024
Copy link

melvin-bot bot commented Feb 27, 2024

Triggered auto assignment to @joekaufmanexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Feb 27, 2024

Proposal

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

What is the root cause of that problem?

  • In here, parent category is always set as isSelected: false because the selectedOptions is not pass to getCategoryOptionTree

  • Previously, we use OptionsSelector and we pass selectedOptions to it. Based on selectedOptions data, we know which option is selected and display it properly. But in PR, we use SelectionList instead

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

  • In getCategoryOptionTree function, we can pass the selectedOptionsName and use it to check if the option is selected or not. It will become to:
+function getCategoryOptionTree(options: Record<string, Category> | Category[], isOneLine = false, selectedOptionsName): Option[] {
    const optionCollection = new Map<string, Option>();
           ...

            optionCollection.set(option.name, {
                ...
+              isSelected: !!option.isSelected || selectedOptionsName.includes(searchText),
            });

            return;
        }

What alternative solutions did you explore? (Optional)

  • In the main solution, we also can replace:
 isSelected: !!option.isSelected || selectedOptionsName.includes(searchText),

by:

 isSelected: isChild ? !!option.isSelected : selectedOptionsName.includes(searchText),

@greg-schroeder greg-schroeder changed the title [$500] Category - Parent that has own category is not ticked in All list when selected [$500] [MEDIUM] Categories: Parent that has own category is not ticked in All list when selected Feb 27, 2024
@greg-schroeder greg-schroeder changed the title [$500] [MEDIUM] Categories: Parent that has own category is not ticked in All list when selected [$500][MEDIUM] Categories: Parent that has own category is not ticked in All list when selected Feb 27, 2024
@hoangzinh
Copy link
Contributor

@blimpich I think it's a regression from #35567. I haven't found which line causes this issue yet, but when I revert this PR, this issue is no longer reproducible. Should we let the author fix or we open it for external contributors?

@dukenv0307
Copy link
Contributor

dukenv0307 commented Feb 28, 2024

@hoangzinh I mentioned the RCA in my proposal why PR #35567 caused the bug

@blimpich
Copy link
Contributor

@hoangzinh it looks like there's another bug caused by the same PR that is going ahead with a fix, so for this case lets go forward with having this be open for external contributors.

I don't think that this should've had external immediately applied to it, but I'll ask internally if we had a process change in order to make sure of that. For now lets move forward with this as a normal issue 👍

@joekaufmanexpensify
Copy link
Contributor

@dukenv0307 is there an ETA for a PR here?

@dukenv0307
Copy link
Contributor

I am working on the PR

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Mar 6, 2024
@dukenv0307
Copy link
Contributor

@hoangzinh PR #37805 is ready to review

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 13, 2024
@melvin-bot melvin-bot bot changed the title [$500][MEDIUM] Categories: Parent that has own category is not ticked in All list when selected [HOLD for payment 2024-03-20] [$500][MEDIUM] Categories: Parent that has own category is not ticked in All list when selected Mar 13, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

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

Copy link

melvin-bot bot commented Mar 13, 2024

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

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

Copy link

melvin-bot bot commented Mar 13, 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:

@joekaufmanexpensify
Copy link
Contributor

@hoangzinh could you please handle checklist so we can prep to issue payment?

@hoangzinh
Copy link
Contributor

@joekaufmanexpensify @blimpich Because this is a DB, could you someone please check if we already have a regression test for it? Otherwise, I will propose a new one.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 20, 2024
@joekaufmanexpensify
Copy link
Contributor

@hoangzinh the scope of this issue only impacts sub-categories, correct? If so, I think this is a pretty niche case, and a regression test for every run is probably not needed.

@hoangzinh
Copy link
Contributor

the scope of this issue only impacts sub-categories, correct?

Yes it's correct. Do you mean this issue is an edge case and we don't need a regression test for it?

@joekaufmanexpensify
Copy link
Contributor

Yep, that's correct. Could you please do the rest of the checklist? And then I'll issue payment.

@hoangzinh
Copy link
Contributor

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR: 20354 category picker list refactor #35567
  • 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/35567/files#r1534051972
  • 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: N/A
  • Determine if we should create a regression test for this bug: ❌ It's an edge case and we don't need a regression test for it.

@joekaufmanexpensify
Copy link
Contributor

TY! All set to issue payment. We need to pay:

@joekaufmanexpensify
Copy link
Contributor

@hoangzinh $500 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

@dukenv0307 $500 sent and contract ended!

@joekaufmanexpensify
Copy link
Contributor

Upwork job closed.

@joekaufmanexpensify
Copy link
Contributor

All set, thanks everyone!

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
Development

No branches or pull requests

5 participants