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
Fix stacking invalid order requests #2796
Fix stacking invalid order requests #2796
Conversation
@lukeromanowicz for sure You will add it - but we probably need to check the response statuses and not stack the orders with failing validation, but probably stack the orders with server error - and surely with the lack of internet connection. However, when the server is down because of traffic peak in 9/10 cases it will return 502/503 error - so kind of 5xxx |
9c5f7e6
to
debe392
Compare
This PR fixes only handling HTTP 400 responses to order create requests with an invalid address on directOrderSync turned on, so a proper popup is being shown and bad requests are not stacking in the queue. In my opinion, it's not possible to make it work well with directOrderSync being off without #2753 |
In the rare case of the offline mode order error we should show the notification like: “There was an error processing You’re offline order. Probably the ordered products went out of the stock. Please re-order the products or contact us” In this case we have two options for a work around: Of course A is preferred - I bet You can make it :-) Then some day we’ll implement the #2753 We can do B to 1.9 and A to 1.10rc1 if you feel more safe with that but we |
We can merge it in but handling the error messages in case of validation issue plus offline order errors (A or B) is crucial. |
OK could you move the comments out of this PR to kind of issue to not loose the ideas then? @lukeromanowicz |
… canceled after going back to online - closes vuestorefront#2740
@pkarw I've implemented B) for now. Instead of doing A I would suggest rushing #2753 because this part of code needs refactor anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One quick change in if
Related issues
#2663 #2740 #2751
closes #2663 #2740
Short description and why it's useful
It prevents repeating order requests by disabling order caching in case of invalid request body (http code 400).
Screenshots of visual changes before/after (if there are any)
Which environment this relates to
Check your case. In case of any doubts please read about Release Cycle
develop
branch and want to merge it back todevelop
release
branch and want to merge it back torelease
hotfix
ormaster
branch and want to merge it back tohotfix
Upgrade Notes and Changelog
IMPORTANT NOTICE - Remember to update
CHANGELOG.md
with description of your changeContribution and currently important rules acceptance