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

Web - Taxes - RBR shown on expense preview without any errors in the transaction thread #52748

Closed
1 of 8 tasks
IuliiaHerets opened this issue Nov 19, 2024 · 15 comments
Closed
1 of 8 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Weekly KSv2

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 19, 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: 9.0.64-0
Reproducible in staging?: Y
Reproducible in production?: Y
Issue was found when executing this PR: #52309
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Create a workspace
  3. Enable tax feature
  4. Add a tax
  5. Create an expense with the added tax on step 4

Expected Result:

No RBR on the expense

Actual Result:

RBR shown without any errors in the transaction thread

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6669095_1731995117189.bandicam_2024-11-19_08-38-33-101.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @JmillsExpensify
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 19, 2024
Copy link

melvin-bot bot commented Nov 19, 2024

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

@Krishna2323
Copy link
Contributor

Krishna2323 commented Nov 19, 2024

Edited by proposal-police: This proposal was edited at 2024-11-19 10:21:29 UTC.

Proposal


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

Web - Taxes - RBR shown on expense preview without any errors in the transaction thread

What is the root cause of that problem?

  • In hasNoticeTypeViolation we aren't checking for ['taxAmountChanged', 'taxRateChanged'], these notice types shouldn't be used in the NewDot as mentioned here.
    /**
    * Checks if any violations for the provided transaction are of type 'notice'
    */
    function hasNoticeTypeViolation(transactionID: string, transactionViolations: OnyxCollection<TransactionViolation[]>, showInReview?: boolean): boolean {
    return !!transactionViolations?.[ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS + transactionID]?.some(
    (violation: TransactionViolation) => violation.type === CONST.VIOLATION_TYPES.NOTICE && (showInReview === undefined || showInReview === (violation.showInReview ?? false)),
    );
    }

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


  • We should update hasNoticeTypeViolation to check if the violation name is taxAmountChanged' or 'taxRateChanged' and only proceed to the next check if it is not equal to taxAmountChanged' or 'taxRateChanged'.
function hasNoticeTypeViolation(transactionID: string, transactionViolations: OnyxCollection<TransactionViolation[]>, showInReview?: boolean): boolean {
    // We don't want to show these violations on NewDot
    const excludedViolationsName = ['taxAmountChanged', 'taxRateChanged'];
    return !!transactionViolations?.[ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS + transactionID]?.some(
        (violation: TransactionViolation) =>
            !excludedViolationsName.includes(violation.name) &&
            violation.type === CONST.VIOLATION_TYPES.NOTICE &&
            (showInReview === undefined || showInReview === (violation.showInReview ?? false)),
    );
  • If needed, we can also add this check in other violation check util functions like hasWarningTypeViolation, hasViolation.

What alternative solutions did you explore? (Optional)

Result

Copy link

melvin-bot bot commented Nov 25, 2024

@JmillsExpensify Eep! 4 days overdue now. Issues have feelings too...

@JmillsExpensify
Copy link

I actually forget if this is by design. @MonilBhavsar can you clarify?

@Krishna2323
Copy link
Contributor

@JmillsExpensify, it was decided to not show taxRateChanged & taxAmountChanged.

Please see these comments: #41401 (comment) #41649 (comment)

@MonilBhavsar
Copy link
Contributor

#41401 (comment) #41649 (comment)

Reading through these comments.

Looks like we no longer display taxRateChanged and taxAmountChanged notice violation because we have system messages and reviewer/approver can know if it has changed.
That sounds good!

If so, we need to stop sending these violations from server at all for newDot requests and not add any conditional logic on the client side. Also remove the code we have currently

@Krishna2323
Copy link
Contributor

Also remove the code we have currently

@MonilBhavsar, I can work on removing the conditional logic from the frontend if needed.

@JmillsExpensify
Copy link

Nice, thanks both for the refresher. Agree with those comments.

@MonilBhavsar MonilBhavsar self-assigned this Nov 27, 2024
@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2024
@MonilBhavsar
Copy link
Contributor

Working on this today

@melvin-bot melvin-bot bot removed the Overdue label Dec 2, 2024
Copy link

melvin-bot bot commented Dec 3, 2024

@JmillsExpensify @MonilBhavsar this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@MonilBhavsar
Copy link
Contributor

Submitted PR's for review

@MonilBhavsar MonilBhavsar added the Reviewing Has a PR in review label Dec 3, 2024
@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Dec 3, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Dec 5, 2024
@melvin-bot melvin-bot bot changed the title Web - Taxes - RBR shown on expense preview without any errors in the transaction thread [HOLD for payment 2024-12-16] Web - Taxes - RBR shown on expense preview without any errors in the transaction thread Dec 9, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 9, 2024
Copy link

melvin-bot bot commented Dec 9, 2024

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

Copy link

melvin-bot bot commented Dec 9, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.72-1 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-12-16. 🎊

Copy link

melvin-bot bot commented Dec 9, 2024

@MonilBhavsar @JmillsExpensify @MonilBhavsar The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@MonilBhavsar
Copy link
Contributor

no payment is due here. Closing

@github-project-automation github-project-automation bot moved this from Bugs and Follow Up Issues to Done in [#whatsnext] #expense Dec 10, 2024
@MonilBhavsar MonilBhavsar removed the Awaiting Payment Auto-added when associated PR is deployed to production label Dec 10, 2024
@MonilBhavsar MonilBhavsar changed the title [HOLD for payment 2024-12-16] Web - Taxes - RBR shown on expense preview without any errors in the transaction thread Web - Taxes - RBR shown on expense preview without any errors in the transaction thread Dec 10, 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. Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

4 participants