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-15] [Violations] [$500] Multilevel tags - "no longer valid" violation is shown after selecting all the tags #38044

Closed
6 tasks done
kavimuru opened this issue Mar 11, 2024 · 40 comments
Assignees
Labels
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

@kavimuru
Copy link

kavimuru commented Mar 11, 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: 1.4.50-2
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 workspaces that have independent and dependent multilevel tags.
  • Tag requirement is toggled on.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create a manual request without tags.
  4. Go to request details page.
  5. Select all the tags.

Expected Result:

Tag violation will disappear after selecting the tags.

Actual Result:

After selecting all the tag, the last tag shows "no longer valid".

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

Bug6409633_1710163056343.20240311_211507.mp4

Bug6409633_1710163006169!independant_tag.csv

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @dukenv0307
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01e30e5ceb96930999
  • Upwork Job ID: 1767604738588979200
  • Last Price Increase: 2024-03-19
  • Automatic offers:
    • dukenv0307 | Contributor | 0
    • FitseTLT | Contributor | 0
@kavimuru kavimuru added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Mar 11, 2024
Copy link

melvin-bot bot commented Mar 11, 2024

Triggered auto assignment to @laurenreidexpensify (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 11, 2024

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

@kavimuru
Copy link
Author

@grgia 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.

@kavimuru
Copy link
Author

We think this bug might be related to #wave6-collect-submitters. cc @greg-schroeder

@grgia
Copy link
Contributor

grgia commented Mar 11, 2024

Maybe related to #37461

@grgia
Copy link
Contributor

grgia commented Mar 11, 2024

@cead22 cead22 added Daily KSv2 and removed Hourly KSv2 labels Mar 11, 2024
@cead22 cead22 self-assigned this Mar 11, 2024
@cead22 cead22 removed the DeployBlockerCash This issue or pull request should block deployment label Mar 11, 2024
@cead22
Copy link
Contributor

cead22 commented Mar 11, 2024

Taking over because this definitely comes from my PR. That said, let's not block deploys on this since violations are in beta

@grgia grgia removed their assignment Mar 11, 2024
@cead22 cead22 moved this to Release 1: Spring 2024 (May) in [#whatsnext] #expense Mar 12, 2024
@cead22
Copy link
Contributor

cead22 commented Mar 12, 2024

I found the problem with this, and it's that we're not using the tag lists orderWeight to check the tag lists in the right order when getTagViolationsForMultiLevelTags, and the following diff seems to solve the problem

diff --git a/src/libs/Violations/ViolationsUtils.ts b/src/libs/Violations/ViolationsUtils.ts
index fe2e5af537..b6aa513072 100644
--- a/src/libs/Violations/ViolationsUtils.ts
+++ b/src/libs/Violations/ViolationsUtils.ts
@@ -55,7 +55,11 @@ function getTagViolationsForMultiLevelTags(
     policyRequiresTags: boolean,
     policyTagList: PolicyTagList,
 ): TransactionViolation[] {
-    const policyTagKeys = Object.keys(policyTagList);
+    let orderedTagList = new Array(Object.keys(policyTagList).length);
+    for (const tagList in policyTagList) {
+        orderedTagList[policyTagList[tagList].orderWeight] = policyTagList[tagList].name;
+    }
+    const policyTagKeys = orderedTagList;
     const selectedTags = updatedTransaction.tag?.split(CONST.COLON) ?? [];
     let newTransactionViolations = [...transactionViolations];
     newTransactionViolations = newTransactionViolations.filter(

I'm going to label this External to get a proper proposal and move this forward

@cead22 cead22 added the External Added to denote the issue can be worked on by a contributor label Mar 12, 2024
@melvin-bot melvin-bot bot changed the title Multilevel tags - "no longer valid" violation is shown after selecting all the tags [$500] Multilevel tags - "no longer valid" violation is shown after selecting all the tags Mar 12, 2024
Copy link

melvin-bot bot commented Mar 12, 2024

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

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

melvin-bot bot commented Mar 20, 2024

📣 @FitseTLT 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@dukenv0307
Copy link
Contributor

@FitseTLT Waiting for your PR

@JmillsExpensify
Copy link

PR is on staging, so we'll start the regression period as soon as this hits production.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 8, 2024
@melvin-bot melvin-bot bot changed the title [Violations] [$500] Multilevel tags - "no longer valid" violation is shown after selecting all the tags [HOLD for payment 2024-04-15] [Violations] [$500] Multilevel tags - "no longer valid" violation is shown after selecting all the tags Apr 8, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

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

Copy link

melvin-bot bot commented Apr 8, 2024

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

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

Copy link

melvin-bot bot commented Apr 8, 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:

  • [@dukenv0307] The PR that introduced the bug has been identified. Link to the PR:
  • [@dukenv0307] 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:
  • [@dukenv0307] 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:
  • [@dukenv0307] Determine if we should create a regression test for this bug.
  • [@dukenv0307] 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.
  • [@laurenreidexpensify] 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 Apr 14, 2024
@laurenreidexpensify
Copy link
Contributor

Payment Summary:

@laurenreidexpensify
Copy link
Contributor

Waiting on @dukenv0307 to complete checklist and confirm regression steps

@melvin-bot melvin-bot bot added the Overdue label Apr 16, 2024
@laurenreidexpensify laurenreidexpensify removed the Awaiting Payment Auto-added when associated PR is deployed to production label Apr 17, 2024
@laurenreidexpensify
Copy link
Contributor

Bump for checklist @dukenv0307

@melvin-bot melvin-bot bot removed the Overdue label Apr 17, 2024
@dukenv0307
Copy link
Contributor

BugZero Checklist:

  • The PR that introduced the bug has been identified. Link to the PR: N/A
  • 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
  • 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. 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

@dukenv0307
Copy link
Contributor

@laurenreidexpensify Sorry for the delay. I completed the checklist ^

@github-project-automation github-project-automation bot moved this from Release 1: Spring 2024 (May) to Done in [#whatsnext] #expense Apr 19, 2024
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. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
Status: Done
Development

No branches or pull requests

10 participants