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-04-05] [$250] [Categories] - Category row is not grayed out entirely when disabled offline #38262

Closed
6 tasks done
m-natarajan opened this issue Mar 13, 2024 · 48 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Mar 13, 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.52-0
Reproducible in staging?: y
Reproducible in production?: no
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
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 admin of Collect workspace.
  1. Go to staging.new.expensify.com.
  2. Go to Settings > Workspaces > Collect workspace.
  3. Go to Categories.
  4. Go offline.
  5. Click on the checkbox of any category.
  6. Click dropdown menu > Disable categories (or Enable if disabled).

Expected Result:

The entire category row will appear grayed out.

Actual Result:

Only the status column is grayed 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

Bug6412862_1710369793014.bandicam_2024-03-14_04-34-17-866.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013df311dce09e48bb
  • Upwork Job ID: 1768698540734349312
  • Last Price Increase: 2024-03-15
  • Automatic offers:
    • cubuspl42 | Reviewer | 0
    • Krishna2323 | Contributor | 0
Issue OwnerCurrent Issue Owner: @puneetlath
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 13, 2024
Copy link

melvin-bot bot commented Mar 13, 2024

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

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 Mar 13, 2024

Current assignee @puneetlath is eligible for the Engineering assigner, not assigning anyone new.

@ikevin127

This comment has been minimized.

@akinwale
Copy link
Contributor

I believe this behaviour is intentional since it's the state value (enabled / disabled) that's changing. @ArekChr can confirm.

@Krishna2323
Copy link
Contributor

Krishna2323 commented Mar 14, 2024

Proposal

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

Categories - Category row is not grayed out entirely when disabled offline

What is the root cause of that problem?

Offending PR: #37734

We set pendingFields instead of pendingAction when enabling/disabling category

App/src/libs/actions/Policy.ts

Lines 2655 to 2657 in 13f8bc0

pendingFields: {
enabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
},

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

Instead of adding pendingFields we should add pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE when updating the category, just like we do when creating a category. Or just add pendingAction without removing pendingFields.

Result

enabled.disable_category_pendingAction.mp4

@nkdengineer
Copy link
Contributor

Proposal

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

Only the status column is grayed out.

What is the root cause of that problem?

When we disable the category, we update pendingFields of category and I think it's expected that we update the pendingField like this

App/src/libs/actions/Policy.ts

Lines 2654 to 2656 in b7a230e

errors: null,
pendingFields: {
enabled: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,

but we don't get this as pendingAction here so the category row isn't grayed out

pendingAction: value.pendingAction,

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

We should update the pendingAction here by fallback value.pendingFields.enable

pendingAction: value.pendingAction || value?.pendingFields?.enabled,

pendingAction: value.pendingAction,

OPTIONAL: In the feature we can have other pendingFields like name, ... We can create a utils like getCategoryPendingAction and use it in all places that we want to get the pendingAction of category. We can do the same for tag or other policy features

What alternative solutions did you explore? (Optional)

NA

@ikevin127
Copy link
Contributor

ArekChr can confirm.

Offending PR #37734 - which is still within the regression period (deployed to staging 17h ago, see #37734 (comment)).

@mountiny mountiny added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Mar 14, 2024
@mountiny mountiny assigned mountiny and unassigned puneetlath Mar 14, 2024
@mountiny
Copy link
Contributor

This is not a blocker, new feature we work on in Simplified Collect, taking the issue on.

We are discussing the pending fields/ error handling on this table component

@luacmartins
Copy link
Contributor

@mountiny do you have a link to the discussion?

@mountiny
Copy link
Contributor

Sorry it was this one https://expensify.slack.com/archives/C036QM0SLJK/p1710425480916719 seems like this is already se up so we can proceed with implementation

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Mar 15, 2024
@melvin-bot melvin-bot bot changed the title Categories - Category row is not grayed out entirely when disabled offline [$500] Categories - Category row is not grayed out entirely when disabled offline Mar 15, 2024
Copy link

melvin-bot bot commented Mar 15, 2024

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

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

Krishna2323 commented Mar 18, 2024

You mean deselecting all tags is expected behaviour like we do with categories, right?

const navigateToCategorySettings = (category: PolicyOption) => {
setSelectedCategories({});
Navigation.navigate(ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(route.params.policyID, category.keyForList));
};

const navigateToTagSettings = (tag: PolicyOption) => {
Navigation.navigate(ROUTES.WORKSPACE_TAG_SETTINGS.getRoute(route.params.policyID, tag.keyForList));
};

@mountiny
Copy link
Contributor

@Krishna2323 yes, tags should follow what categories do now

When you open RHP, all tags/ categories should de deselected.

@mountiny
Copy link
Contributor

I found that when we update category in offline mode the row is disabled, do we need to do that for tags also? Haven't added recordings since we might want to fix this as well.

regarding this, we are still discussing internally, its not in scope of this PR

@Krishna2323 could you however align the tags behaviour with categories in your PR please? Thank you

@Krishna2323
Copy link
Contributor

Will fix that also, thanks.

@trjExpensify
Copy link
Contributor

Where we at with this? What's the ETA on the PR? Thanks!

@trjExpensify trjExpensify changed the title [$250] Categories - Category row is not grayed out entirely when disabled offline [$250] [Categories] - Category row is not grayed out entirely when disabled offline Mar 21, 2024
@cubuspl42
Copy link
Contributor

@trjExpensify

In review. ETA today/tomorrow. Do you know whether the category UI element should be completely disabled when grayed out? I.e. should I be able to click/tap it to display the details, or maybe change the category name?

@luacmartins
Copy link
Contributor

I think users should be able to interact with it and update other values, unless the row is in a pending delete state, in which case it should be disabled

@trjExpensify
Copy link
Contributor

Agree with what Carlos said!

@Krishna2323
Copy link
Contributor

@luacmartins, are you sure we don't need to disabled the tags/categories when updated offline, I guess it was intentionally added in this #37734.

BTW we aren't making any changes related to disabling the tag/categories in this PR, the disabling only happens with categories which was added in the PR linked above. But still if we need to change that we can handle that in #38663

@cubuspl42
Copy link
Contributor

I raised this topic, because it felt odd; in most cases, we can edit the thing that has pending offline actions. But we didn't change anything in this aspect in our PR, so maybe let's consider this out of scope?

@trjExpensify
Copy link
Contributor

@luacmartins, are you sure we don't need to disabled the tags/categories when updated offline,

Are you specifically asking in the pending create state or the pending delete case? Because they are handled differently.

If you add a category offline, you can edit its settings as well. Generally the philosophy here is that we should let people "work" offline as much as possible. So blocking them from being able to edit the category they just added goes against that. It would be somewhat pointless to allow you to add categories when offline if we didn't.

If you delete a category offline, you can't edit its settings. It's treated as if you deleted it when online, the only difference is that it's still displayed as a breadcrumb while its pending to confirm the action was successful.

@luacmartins
Copy link
Contributor

Agree with Tom. So the only instance in which we should disable the row is when it's pending to be deleted. Adding or updating any field should not block the user from interacting with it again.

@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 29, 2024
@melvin-bot melvin-bot bot changed the title [$250] [Categories] - Category row is not grayed out entirely when disabled offline [HOLD for payment 2024-04-05] [$250] [Categories] - Category row is not grayed out entirely when disabled offline Mar 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

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

Copy link

melvin-bot bot commented Mar 29, 2024

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

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

Copy link

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

  • [@cubuspl42] The PR that introduced the bug has been identified. Link to the PR:
  • [@cubuspl42] 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:
  • [@cubuspl42] 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:
  • [@cubuspl42] Determine if we should create a regression test for this bug.
  • [@cubuspl42] 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:

@mountiny
Copy link
Contributor

$250 to @Krishna2323 and $250 to @cubuspl42

@mountiny
Copy link
Contributor

Puneet has been originally assigned using the bug label so adding you to handle payments here, thank you!

@puneetlath
Copy link
Contributor

@cubuspl42 friendly reminder on the checklist so that we can pay tomorrow.

@cubuspl42
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR:
  • 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:
  • 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:
    • No need for additional discussion
  • Determine if we should create a regression test for this bug.
    • No
  • 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.
    • N/A

@puneetlath
Copy link
Contributor

All paid. 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. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests

10 participants