-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Somehow, each of the line items in one order have 3 tax_lines with identical data. #1901
Comments
Thanks for reporting it in @dwene! We'll attend to it immediately and release a fix asap. Will keep you posted :) |
Also, @dwene @olivermrbl that pr #1894 will probably fix some issues as well around transaction and wrong object usage. Might not fix everything but it could help |
@dwene Latest release includes a bunch of fixes around transactions in the core. Let us know if the issue persists, when you get a chance to update to latest |
I've identified a potential issue in the order creation process, where the tax rate triples after transforming a cart into an order. Below is the relevant code and logs that highlight the problem: Path: OrderService - createFromCart
Logs
Observation:
It's worth noting that the "line item update" log is from the line-item service, which I suspect isn't the root of the problem. Would appreciate insights on potential fixes or workarounds. |
Found the in our case We are using a custom cart-completion strategy based on the one provided in the strategies folder in the medusa repository. In here, in the
|
We are hitting this issue as well. Pretty big blocker for us to use a custom tax provider. I mentioned it on discord, and only just now saw this issue |
We don't have a custom cart completion strategy, but rather a custom tax provider |
Ok, figured it out. Because of the fix in #1262, |
While I was developing a custom tax provider, I ran into a pretty frustrating issue related to multiple tax lines and incorrect / unexpected tax total calculations. I outlined the issue in discord, before finding the solution: https://discord.com/channels/876835651130097704/1169705457804398662 After some digging, I found this issue from a while back: #1262, where it states there is now a unique constraint on `item_id, code` and `shipping_method_id, code`. But, in the current documentation for creating a custom tax provider, it states these fields as part of the tax line items returned are optional. If these `code` values are left out, it can cause tax lines to be applied multiple times (as seen here as well: #1901) I'm not entirely sure how this should be phrased in the documentation, so I just wanted to get this up and on your radar for resolution. If it ends up being that `code` truly should not be optional, I suspect some type definitions would need to change as well?
Bug report
We use a 3rd party plugin to calculate taxes, using the Medusa tax plugin system.
I noticed one of my recent orders had 3x the tax I was expecting. Looking at the order it appears that each line_item has 3 tax lines, each with the same percentage added. Seems like somehow the tax lines were added 3 times. I would expect that if any part of the order failed, it would be rolled back in a transaction, but that didn't appear to happen.
Describe the bug
https://www.loom.com/share/2f6ce6cc7ba34a08b8296ad505804052
Tax is 3x higher than it should be
System information
Medusa version (including plugins): .1.3.4
Node.js version: 14
Database: PG
Operating system: Linux
Browser (if relevant):
Steps to reproduce the behavior
See above.
Expected behavior
Screenshots
Code snippets
Additional context
Add any other context about the problem here
The text was updated successfully, but these errors were encountered: