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

[$250] QBO - Main tag row is not grayed out when tag name or subtag is edited offline #43379

Closed
6 tasks done
lanitochka17 opened this issue Jun 10, 2024 · 45 comments
Closed
6 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review

Comments

@lanitochka17
Copy link

lanitochka17 commented Jun 10, 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.81-1
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

Issue found when executing PR #43005

Action Performed:

Precondition:

  • Workspace is connected to QBO
  1. Go to staging.new.expensify.com
  2. Go to workspace settings
  3. Go to Tags
  4. Go offline
  5. Click on any tag (Classes or Customers/Projects)
  6. Edit the tag name or edit any subtag
  7. Dismiss the RHP

Expected Result:

The main tag (Classes or Customers/Projects) will be grayed out when the tag name or subtag is edited

Actual Result:

The main tag (Classes or Customers/Projects) is not grayed out when the tag name or subtag is edited

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

Bug6508123_1718029397049.20240610_221233.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019a5f373ffd1d9267
  • Upwork Job ID: 1803445339997697727
  • Last Price Increase: 2024-06-19
  • Automatic offers:
    • eh2077 | Reviewer | 102877092
Issue OwnerCurrent Issue Owner: @eh2077
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 10, 2024
Copy link

melvin-bot bot commented Jun 10, 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.

@lanitochka17
Copy link
Author

@miljakljajic 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

@lanitochka17
Copy link
Author

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

@devguest07
Copy link
Contributor

Proposal

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

The main tag row is not grayed out when the tag name or subtag is edited offline.

What is the root cause of that problem?

On the Workspace tags page, for multi-level tags, there isn't a pendingAction field. This omission means that changes made offline do not trigger the necessary visual indicator.

if (isMultiLevelTags) {

pendingAction: tag.pendingAction,

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

For multi-level tags, we need to check all the child tags and determine if any have a pendingAction field. If so, we should update the main tag row to reflect this.

const hasPendingAction = Object.values(policyTagList.tags).some(tag => tag.pendingAction);

return { 
  // ..
  pendingAction: hasPendingAction,

What alternative solutions did you explore?

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jun 11, 2024

Proposal

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

QBO - Main tag row is not grayed out when tag name or subtag is edited offline

What is the root cause of that problem?

For multi level tags we don't set the pendingAction field. We missed to add pendingAction: policyTagList.pendingAction and we also don't check for any pending action in the child tags.

if (isMultiLevelTags) {
return policyTagLists.map((policyTagList) => ({
value: policyTagList.name,
orderWeight: policyTagList.orderWeight,
text: PolicyUtils.getCleanedTagName(policyTagList.name),
keyForList: String(policyTagList.orderWeight),
isSelected: selectedTags[policyTagList.name],
enabled: true,
required: policyTagList.required,
rightElement: (
<ListItemRightCaretWithLabel
labelText={policyTagList.required ? translate('common.required') : undefined}
shouldShowCaret={false}
/>
),
}));

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

We should use policyTagList.pendingAction and also check if any child has a pending action and set the pendingAction field accordingly.

        if (isMultiLevelTags) {
            return policyTagLists.map((policyTagList) => {
                const hasChildPendingAction = Object.values(policyTagList.tags).some((tag) => tag.pendingAction);

                return {
                    value: policyTagList.name,
                    orderWeight: policyTagList.orderWeight,
                    text: PolicyUtils.getCleanedTagName(policyTagList.name),
                    keyForList: String(policyTagList.orderWeight),
                    isSelected: selectedTags[policyTagList.name],
                    enabled: true,
                    required: policyTagList.required,
                    pendingAction: policyTagList.pendingAction ?? (hasChildPendingAction ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : undefined),
                    rightElement: (
                        <ListItemRightCaretWithLabel
                            labelText={policyTagList.required ? translate('common.required') : undefined}
                            shouldShowCaret={false}
                        />
                    ),
                };
            });
        }

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jun 12, 2024
Copy link

melvin-bot bot commented Jun 13, 2024

@miljakljajic Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Jun 17, 2024

@miljakljajic Still overdue 6 days?! Let's take care of this!

@miljakljajic miljakljajic added the External Added to denote the issue can be worked on by a contributor label Jun 19, 2024
Copy link

melvin-bot bot commented Jun 19, 2024

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

@melvin-bot melvin-bot bot changed the title QBO - Main tag row is not grayed out when tag name or subtag is edited offline [$250] QBO - Main tag row is not grayed out when tag name or subtag is edited offline Jun 19, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jun 19, 2024
Copy link

melvin-bot bot commented Jun 19, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jun 19, 2024
@Krishna2323
Copy link
Contributor

Proposal updated

  • Minor updated in RCA

@eh2077
Copy link
Contributor

eh2077 commented Jun 20, 2024

Thank you for your proposals!

@Krishna2323 focused on getting detail coding changes while their proposal doesn’t seem to have significant difference compared to the previous one.

I think we should go with @devguest07 's proposal as they're the first to point out the root cause. I also agreed with their idea to get it fixed.

For multi-level tags, we need to check all the child tags and determine if any have a pendingAction field. If so, we should update the main tag row to reflect this.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Jun 20, 2024

Triggered auto assignment to @AndrewGable, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@Krishna2323
Copy link
Contributor

@eh2077, I think you missed this part of my proposal, we also need to set the policyTagList.pendingAction for pending action value else the tag won't be grayed out when tag details are changed.

We missed to add pendingAction: policyTagList.pendingAction

Monosnap.screencast.2024-06-20.20-17-54.mp4

@eh2077
Copy link
Contributor

eh2077 commented Jun 20, 2024

@Krishna2323 Thanks for your comment but I think the selected proposal covers the change you mentioned.

@Krishna2323
Copy link
Contributor

For multi-level tags, we need to check all the child tags and determine if any have a pendingAction field. If so, we should update the main tag row to reflect this.

const hasPendingAction = Object.values(policyTagList.tags).some(tag => tag.pendingAction);

return { 
  // ..
  pendingAction: hasPendingAction,

@eh2077, I can't find any mention about adding policyTagList.pendingAction.

@eh2077
Copy link
Contributor

eh2077 commented Jun 20, 2024

@Krishna2323 I appreciated your effort to discuss the specific detail coding changes. But I still don’t agree with you that your proposal has contributed significant difference compared to the selected one.

I believe @devguest07 's description about the change needed and together with pseudocode are enough for the solution.

@Krishna2323
Copy link
Contributor

@eh2077, the proposal never suggested using policyTagList.pendingAction, and it clearly mentions adding the pending action only if the child tags have pending actions. It is very clear in the solution details and code snippet that it only checks for the pending action value of child tags. Adding policyTagList.pendingAction is important because of the bug I mentioned here. Please re-evaluate...

For multi-level tags, we need to check all the child tags and determine if any have a pendingAction field. If so, we should update the main tag row to reflect this.

The pending action should be:

pendingAction: policyTagList.pendingAction ?? (hasChildPendingAction ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : undefined),

cc: @AndrewGable

@eh2077
Copy link
Contributor

eh2077 commented Jun 20, 2024

@Krishna2323 Sorry, I still think the idea to update pendingAction is from the selected proposal. In this case (a relatively straightforward issue), I think you can't just translate their pseudocode to specific diff and then claim significant contributions from it.

I tend to stick with my original decision, so I also agreed to defer it to the internal engineering team.

cc @AndrewGable

@Krishna2323
Copy link
Contributor

I think you can't just translate their pseudocode to specific diff and then claim significant contributions from it.

@eh2077, I think you didn't understand what I'm saying. Let me explain more clearly.

The selected proposal states that for multilevel tags, we will check if any child tag has a pending action and, based on that, we will add the pending action. This approach works when we update any child tag in offline mode. However, if we update the parent tag name or make change the required field, the row won't be greyed out, and this case is not covered in the selected proposal. I’m not translating the pseudocode, my proposal will also grey out the option if the parent tag has a pending action or if any child tag has one, whereas the selected proposal only checks for the child pending action.

@Krishna2323
Copy link
Contributor

@AndrewGable, I still can't understand why my proposal wasn't selected. @eh2077 seems to prefer the other proposal, which explicitly states that we only need to check for pending actions in child tags. It never mentions that we also need to add policyTagList.pendingAction, thus failing to cover cases where the main tag is updated offline. In this issue, my proposal was dismissed because I included the change in the RCA section. However, if we compare this issue with that one, the selected proposal doesn't even acknowledge this adding policyTagList.pendingAction.I have no issues with @eh2077's preference, but I believe the change is crucial and was never stated in the selected proposal. Feel free to make the decision :)

For multi-level tags, we need to check all the child tags and determine if any have a pendingAction field. If so, we should update the main tag row to reflect this.

@devguest07
Copy link
Contributor

PR in progress. I encountered an issue with running the iPhone simulator (this is my first time with this project). I will fix it ASAP and make the PR ready for review. Apologies for the delay.

@melvin-bot melvin-bot bot added the Overdue label Jun 28, 2024
@eh2077
Copy link
Contributor

eh2077 commented Jun 28, 2024

@devguest07 You can also post issues you encountered here or on the expensify-open-source slack channel

@melvin-bot melvin-bot bot removed the Overdue label Jun 28, 2024
@devguest07
Copy link
Contributor

@eh2077 Thank you for your help. The issue was with Mapbox; I was using the default key without read/write access. Regarding Slack, I still don't have access. I requested an invitation via email a few weeks ago but haven't received it yet. The PR will be ready in a few hours.

@melvin-bot melvin-bot bot added the Overdue label Jul 1, 2024
@eh2077
Copy link
Contributor

eh2077 commented Jul 1, 2024

@devguest07 You can refer to this post from Slack.

sk.eyJ1IjoiaGF5YXRhIiwiYSI6ImNsbG11NjRqcDI5aDUzZnFsemQ1bzJ6a2sifQ.0w52KN5Ak4AMiwiW-MnWHg

image

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Overdue Daily KSv2 labels Jul 1, 2024
@devguest07
Copy link
Contributor

@eh2077 @AndrewGable I think automation failed here!

@AndrewGable
Copy link
Contributor

Yes, looks like it has been deployed for a while. @miljakljajic - Can we pay this one out?

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Jul 24, 2024
Copy link

melvin-bot bot commented Jul 24, 2024

This issue has not been updated in over 15 days. @AndrewGable, @miljakljajic, @eh2077, @devguest07 eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@eh2077
Copy link
Contributor

eh2077 commented Aug 7, 2024

Checklist

  • [@eh2077] The PR that introduced the bug has been identified. Link to the PR: I can't figure out the specific PR that caused this bug.
  • [@eh2077] 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
  • [@eh2077] 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
  • [@eh2077] Determine if we should create a regression test for this bug. Yes

Regression test

Precondition:

Workspace is connected to QBO

  • Go to staging.new.expensify.com
  1. Go to workspace settings
  2. Go to Tags
  3. Go offline
  4. Click on any tag (Classes or Customers/Projects)
  5. Edit the tag name or edit any subtag
  6. Dismiss the RHP
  7. Verify that the main tag (Classes or Customers/Projects) will be grayed out.

Do we agree 👍 or 👎

@eh2077
Copy link
Contributor

eh2077 commented Aug 7, 2024

@miljakljajic This is due for payment, please take a look at this when you get a chance. Thx

@miljakljajic
Copy link
Contributor

Apologies, paid!

@devguest07
Copy link
Contributor

@miljakljajic I am not paid, my profile was frozen, can you pls pay me?
https://www.upwork.com/freelancers/~01020d097e810d1b07

@devguest07
Copy link
Contributor

@miljakljajic can you pls pay me? Thank you

@devguest07
Copy link
Contributor

@AndrewGable this is closed without getting paid! Can you pls help!

@AndrewGable AndrewGable reopened this Aug 28, 2024
@AndrewGable
Copy link
Contributor

@miljakljajic - Can you double check @devguest07's payment? Thank you!

@miljakljajic
Copy link
Contributor

offer extended

@devguest07
Copy link
Contributor

@miljakljajic offer accepted

@miljakljajic
Copy link
Contributor

Paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Monthly KSv2 Reviewing Has a PR in review
Projects
Status: Done
Development

No branches or pull requests

6 participants