-
Notifications
You must be signed in to change notification settings - Fork 287
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
Taxes not updated reactively - need GraphQL subscription #469
Comments
I noticed this when I was testing, too, but there isn't any easy solution. The recalc happens async on the server, so the response doesn't have the updates. The next response usually does, but then it doesn't have those updates. So it's essentially always one change behind. The proper solution is to use a GraphQL subscription for part of cart. We were waiting to introduce subscriptions until we had a use case, and this might be a good test case. |
@aldeed @kieckhafer Testing checkout today it appears that this is still not working. Is there any status update on this? |
@kkuzemka @kieckhafer do either of you know if/who picked this up? |
@zenweasel is this not working for you here in this repo? or in another location? It is (or at least was) fixed in a non-subscription manner, and this was left open to deal with subscriptions in the future. |
I included reproduction steps in the slack message as it includes non-public URL's. It is definitely not working still as of yesterday |
The previous "solution" was based on re-finding the doc that is returned from a mutation after events are emitted and awaited. I think we only did this in one mutation, so I would look specifically into which mutations are getting called to update the cart. Maybe other mutations need the same kind of change. But without subs, we’re only buying time. Subs are the correct solution but ideally we should figure out a better pubsub provider first (which logically would be Kafka since we already require it now). A middle-ground workaround for now would be to set Or similarly, we could add some code in the UI that does a single re-fetch 5 seconds after each cart mutation. |
@rosshadden can we close this now? Or do we need to merge/migrate your changes into this repo? |
Has there been any further work to actually use subscriptions beside the I'd really be interested to gain more insights into your current roadmap. |
@rosshadden Second call to close or update this ticket. It's been 3 weeks since the last update |
My changes were not in this project. I can try porting them over here, but I would need to find time to test the changes. |
@janus-reith On the server side, it is hard coded to use an But Apollo folks do not recommend using it for production. I'm not sure it will work correctly for installations running multiple instances of the server. Using Kafka would solve this, or at a bare minimum it should be possible for a plugin to override the pub sub provider. |
Thank you, now I get it. |
Type: major
Describe the bug
When changing the quantity of the items or shipping address, the tax calculated is not updated reactively, the page has to be refreshed to get the taxes.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The taxes should be updated reactively.
The text was updated successfully, but these errors were encountered: