Skip to content

[HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Categories - All categories disappear instead of crossed out when deleted offline  #43127

Closed

Description

@lanitochka17

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-79-7
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Workspace has categories and tags
  1. Go to staging.new.expensify.com
  2. Go to workspace settings > Tags
  3. Go offline
  4. Delete all tags
  5. Note that all tags are crossed out
  6. Go to Categories
  7. Delete all categories
  8. Note that it shows empty state instead of all categories being crossed out

Expected Result:

All the categories will be crossed out when deleted offline

Actual Result:

Categories page shows empty state instead of showing all deleted categories being crossed out

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

Bug6502754_1717593147881.bandicam_2024-06-05_21-11-17-153.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01175e1115f886adb6
  • Upwork Job ID: 1798665482258834419
  • Last Price Increase: 2024-06-06
  • Automatic offers:
    • situchan | Reviewer | 102704204
    • rayane-djouah | Contributor | 102713455
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 5, 2024
  2. melvin-bot commented on Jun 5, 2024

    @melvin-bot

    Triggered auto assignment to @laurenreidexpensify (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. lanitochka17 commented on Jun 5, 2024

    @lanitochka17
    Author

    @laurenreidexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

  4. lanitochka17 commented on Jun 5, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #wave-collect - Release 1

  5. dragnoir commented on Jun 5, 2024

    @dragnoir
    Contributor

    Proposal

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

    Removed categories hidden when offline

    What is the root cause of that problem?

    On WorkspaceTagsPage we check the display of the SelectionList with hasVisibleTag

    https://github.com/Expensify/App/blob/66b4072db8ec86a8eed2d6e765a52eae3c9c68d4/src/pages/workspace/tags/WorkspaceTagsPage.tsx#L341C18-L341C32

    but on WorkspaceCategoriesPage we do the same display check with !shouldShowEmptyState

    {!shouldShowEmptyState && !isLoading && (

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

    on WorkspaceCategoriesPage we need to fix shouldShowEmptyState to be the same as we use on WorkspaceTagsPage

    const shouldShowEmptyState = !categoryList.some((category) => category.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) && !isLoading;

    const  hasVisibleCategories  =  categoryList.some((category) =>  category.pendingAction  !==  CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) ||  isOffline;
    
    }
    
    {!hasVisibleCategories && !isLoading && (
      <WorkspaceEmptyStateSection
    
    {hasVisibleCategories && !isLoading && (
     <SelectionList

    What alternative solutions did you explore?

  6. Tony-MK commented on Jun 5, 2024

    @Tony-MK
    Contributor

    Proposal

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

    Categories - All categories disappear instead of crossed out when deleted offline

    What is the root cause of that problem?

    The root cause of the problem is that the WorkspaceTagsPage has a condition for shouldShowEmptyState which only true by checking the if some the categories have pendingAction of DELETE in the categoryList instead of all.

    {shouldShowEmptyState && (
    <WorkspaceEmptyStateSection
    title={translate('workspace.categories.emptyCategories.title')}
    icon={Illustrations.EmptyStateExpenses}
    subtitle={translate('workspace.categories.emptyCategories.subtitle')}
    />
    )}

    const shouldShowEmptyState = !categoryList.some((category) => category.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) && !isLoading;

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

    On the WorkspaceTagsPage, the condition of shouldShowEmptyState should be like the one below.

    const shouldShowEmptyState = categoryList.all((category) => category.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) && !isLoading;
    
  7. bernhardoj commented on Jun 5, 2024

    @bernhardoj
    Contributor

    Proposal

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

    Category shows empty view state instead of crossed out categories list while offline.

    What is the root cause of that problem?

    The empty view state will be shown if every item is PENDING_DELETE even if it's offline.

    const shouldShowEmptyState = !categoryList.some((category) => category.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) && !isLoading;

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

    We should do the same with tags page where it consider the offline status.

    const hasVisibleTag = tagList.some((tag) => tag.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || isOffline);

    It would be easier for us to read the condition above (because it's not a negated variable), so I suggest to follow the same pattern in tags page and apply it to the categories page.

    const hasVisibleCategories = categoryList.some((category) => category.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE || isOffline);
    

    and adjust the other code usages.

  8. melvin-bot commented on Jun 6, 2024

    @melvin-bot
  9. changed the title [-]Categories - All categories disappear instead of crossed out when deleted offline [/-] [+][$250] Categories - All categories disappear instead of crossed out when deleted offline [/+] on Jun 6, 2024
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 6, 2024
  11. melvin-bot commented on Jun 6, 2024

    @melvin-bot

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

  12. 35 remaining items

  13. changed the title [-][$250] Categories - All categories disappear instead of crossed out when deleted offline [/-] [+][HOLD for payment 2024-07-17] [$250] Categories - All categories disappear instead of crossed out when deleted offline [/+] on Jul 10, 2024
  14. melvin-bot commented on Jul 10, 2024

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.5-13 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-07-17. 🎊

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

  15. melvin-bot commented on Jul 10, 2024

    @melvin-bot

    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:

    • [@rayane-djouah / @situchan] The PR that introduced the bug has been identified. Link to the PR:
    • [@rayane-djouah / @situchan] 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:
    • [@rayane-djouah / @situchan] 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:
    • [@rayane-djouah / @situchan] Determine if we should create a regression test for this bug.
    • [@rayane-djouah / @situchan] 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.
    • [@mallenexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  16. changed the title [-][HOLD for payment 2024-07-17] [$250] Categories - All categories disappear instead of crossed out when deleted offline [/-] [+][HOLD for payment 2024-07-22] [HOLD for payment 2024-07-17] [$250] Categories - All categories disappear instead of crossed out when deleted offline [/+] on Jul 15, 2024
  17. melvin-bot commented on Jul 15, 2024

    @melvin-bot

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

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

  18. melvin-bot commented on Jul 15, 2024

    @melvin-bot

    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:

    • [@rayane-djouah / @situchan] The PR that introduced the bug has been identified. Link to the PR:
    • [@rayane-djouah / @situchan] 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:
    • [@rayane-djouah / @situchan] 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:
    • [@rayane-djouah / @situchan] Determine if we should create a regression test for this bug.
    • [@rayane-djouah / @situchan] 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.
    • [@mallenexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  19. mallenexpensify commented on Jul 18, 2024

    @mallenexpensify
    Contributor

    Contributor: @rayane-djouah paid $250 via Upwork
    Contributor+: @situchan paid $250 via Upwork

    @situchan can you please complete the BZ checklist above? Thx

  20. situchan commented on Jul 18, 2024

    @situchan
    Contributor

    Regression Test

    Precondition: Workspace has categories

    1. Go offline
    2. Go to workspace settings > Categories
    3. Delete all categories
    4. Verify that all the categories are crossed out when deleted offline
  21. mallenexpensify commented on Jul 19, 2024

    @mallenexpensify
    Contributor
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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions