-
Notifications
You must be signed in to change notification settings - Fork 8
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
M2P-161 Stop pushing model/quote JS script #822
Conversation
Codecov Report
@@ Coverage Diff @@
## master #822 +/- ##
============================================
+ Coverage 92.86% 93.03% +0.17%
- Complexity 1378 1428 +50
============================================
Files 104 104
Lines 4668 4811 +143
============================================
+ Hits 4335 4476 +141
- Misses 333 335 +2 |
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.
What about the other two instances in this replacejs.phtml
file where we rely on domReady!
?
Good point, but other things are work :) and we haven't changed them for months. Looks like only ' Maybe it makes sense to run all code after domReady, but I think it's too big change for hotfix PR. Let's discuss this during other JS refactoring tasks.. |
That is reasonable, thanks for talking it out. |
* Stop pushing model/quote JS script * Changes after review
We introduced an issue in #796. Actually it was known magento issue that was fixed in new Magento versions, see magento/magento2#23099 , magento/magento2#14412, magento/magento2#21432
Under some conditions, Magento JS script produced an error because they initialated wrong.
We had a fix #808 but now I see it doesn't affect the root of the issue.
In PR 796 we added
require(['Magento_Checkout/js/model/quote'] ...)
thing. This requireJS API means we pushmodel/quote
script to load if it wasn't loaded before. Under some very rare conditions, it triggers incorrect initializing.So solution the same as in magento/magento2#21432 : don't load module/quote script before DOM.loaded. We know that when DOM.loaded we have all parameters to initialize this script.
The issue about a race condition, so it's quite hard to reproduce it. Looks like it happens very rarely.
We need some (or all) of the following conditions:
Fixes: [M2P-161]
#changelog M2P-161 Stop pushing model/quote JS script
Type of change
How Has This Been Tested?
Please validate that you have tested your change in at least one of the following areas:
For PR Reviewer
Checklist: