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] [HOLD for payment 2024-10-24] QBO - Some Customer/projects values are trigger an error that disappears #50105

Closed
1 of 6 tasks
lanitochka17 opened this issue Oct 2, 2024 · 27 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 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

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

Action Performed:

Precondition: workspace with connected QBO integration. Classes and Customers/Projects are imported via Import tab. 'Members must tag all expenses' toggle is ON.

  1. Go to workspace chat
  2. Click + > Submit expense > Manual
  3. Enter amount and Merchant > Submit
  4. Open expense report
  5. Choose Category and Classes values
  6. Click on Customers/projects > choose Coke Drink Canada:Big Project or Coke Drink Canada:Test Test

Expected Result:

Value is applied without error

Actual Result:

An error 'Customers/Projects no longer valid' briefly appears. Sometimes an error stays until user chose another value

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

Bug6622432_1727892498454.bandicam_2024-10-02_20-57-12-446.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021849320215635409078
  • Upwork Job ID: 1849320215635409078
  • Last Price Increase: 2024-10-24
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 2, 2024
Copy link

melvin-bot bot commented Oct 2, 2024

Triggered auto assignment to @kadiealexander (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

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

@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Oct 3, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

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

melvin-bot bot commented Oct 3, 2024

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

@kadiealexander
Copy link
Contributor

cc @arosiclair I know you worked on QBO recently!

@Nodebrute
Copy link
Contributor

Nodebrute commented Oct 3, 2024

Edited by proposal-police: This proposal was edited at 2024-10-03 05:24:47 UTC.

Proposal

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

Customer/projects values trigger an error that disappears. This error is more visible in offline mode.

What is the root cause of that problem?

In this function we get the Violations for independent tags

function getTagViolationForIndependentTags(policyTagList: PolicyTagLists, transactionViolations: TransactionViolation[], transaction: Transaction) {

And here we split the tag based on the colon. The problem is when we have a tag ``
const selectedTags = transaction.tag?.split(CONST.COLON) ?? [];

The problem is when we have a tags with this structure transaction?.tag will be `Jane\:expensify test 1:testing 1` and the colon split will divide this tag into 3 based on the colon `['Jane\', 'expensify test 1', 'testing 1']`
Screenshot 2024-10-03 at 10 10 20 AM

so when in here we try to match it with policy tags it will return an error. This error is fixed when we get the response from BE

const isTagInPolicy = Object.values(tags).some((tag) => tag.name === selectedTag && !!tag.enabled);

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

Instead of using transaction.tag?.split(CONST.COLON) we can use getTagArrayFromName this will split the string correctly

const selectedTags = transaction.tag?.split(CONST.COLON) ?? [];

We can do something like this

 const selectedTags = TransactionUtils.getTagArrayFromName(transaction?.tag ?? '')

Now split will be ['Jane\\:expensify test 1', 'testing 1']

Before
Screen.Recording.2024-10-03.at.10.19.06.AM.mov
After
Screen.Recording.2024-10-03.at.10.18.17.AM.mov

What alternative solutions did you explore? (Optional)

Not recommended but alternate solution will be only in this loop we declare const selectedTags = TransactionUtils.getTagArrayFromName(transaction?.tag ?? '') and use it only in this loop instead of getTagViolationForIndependentTags function

for (let i = 0; i < policyTagKeys.length; i++) {

@arosiclair
Copy link
Contributor

cc @arosiclair I know you worked on QBO recently!

Sorry I don't have much info to give on this issue specifically. Seems like a legit bug though.

@allroundexperts
Copy link
Contributor

@Nodebrute's proposal looks good to me. The RCA seems to be correct and the solution makes sense as well. Let's go with them.

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 7, 2024

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

@MonilBhavsar
Copy link
Contributor

Looks good 👍

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 7, 2024
@Nodebrute Nodebrute mentioned this issue Oct 7, 2024
50 tasks
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 7, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 17, 2024
@melvin-bot melvin-bot bot changed the title QBO - Some Customer/projects values are trigger an error that disappears [HOLD for payment 2024-10-24] QBO - Some Customer/projects values are trigger an error that disappears Oct 17, 2024
Copy link

melvin-bot bot commented Oct 17, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 17, 2024
@allroundexperts
Copy link
Contributor

Checklist

  1. https://github.com/Expensify/App/pull/37461/files#r1807953238
  2. Add violation logic for multi level tags #37461
  3. N/A
  4. I think that this is really an edge case, that was specific to QBO integration. As such, we can skip the test here.

@MonilBhavsar
Copy link
Contributor

I think we should add the tests that uses special tag names with colon inside it, as this bug made to production unnoticed

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Oct 23, 2024
@kadiealexander
Copy link
Contributor

@allroundexperts can you share test instructions that test for @MonilBhavsar's case here? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Oct 24, 2024
@kadiealexander kadiealexander added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Oct 24, 2024
Copy link

melvin-bot bot commented Oct 24, 2024

Current assignee @kadiealexander is eligible for the Bug assigner, not assigning anyone new.

@kadiealexander kadiealexander added External Added to denote the issue can be worked on by a contributor and removed External Added to denote the issue can be worked on by a contributor labels Oct 24, 2024
Copy link

melvin-bot bot commented Oct 24, 2024

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

@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-10-24] QBO - Some Customer/projects values are trigger an error that disappears [$250] [HOLD for payment 2024-10-24] QBO - Some Customer/projects values are trigger an error that disappears Oct 24, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 24, 2024
Copy link

melvin-bot bot commented Oct 24, 2024

Current assignee @allroundexperts is eligible for the External assigner, not assigning anyone new.

@kadiealexander
Copy link
Contributor

kadiealexander commented Oct 24, 2024

Payouts due:

Upwork job is here.

@kadiealexander
Copy link
Contributor

Reassigning to have someone raise a GH to get these requested testing steps into testrail once they're written, as I'm heading OOO!

@kadiealexander kadiealexander removed their assignment Oct 25, 2024
@kadiealexander kadiealexander added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Oct 25, 2024
Copy link

melvin-bot bot commented Oct 25, 2024

Triggered auto assignment to @bfitzexpensify (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.

Copy link

melvin-bot bot commented Oct 28, 2024

@allroundexperts, @MonilBhavsar, @bfitzexpensify, @Nodebrute Whoops! This issue is 2 days overdue. Let's get this updated quick!

@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
@bfitzexpensify
Copy link
Contributor

Bump @allroundexperts

@melvin-bot melvin-bot bot removed the Overdue label Oct 28, 2024
@allroundexperts
Copy link
Contributor

Regression test

  1. Create a workspace, and enable tags + categories.
  2. Add a tag, and category named as "test:new:exfy".
  3. Submit an expense to the workspace, and select the above create tag and category.
  4. Verify that no error occurs and the expense gets submitted successfully.

Do we 👍 or 👎 ?

@bfitzexpensify
Copy link
Contributor

Looks good to me. Closing this one out - 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 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
No open projects
Status: Polish
Development

No branches or pull requests

7 participants