-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 customer data and sections configuration race condition #24847
Conversation
Hi @krzksz. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
@magento give me 2.3-develop instance |
Hi @krzksz. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @krzksz, here is your Magento instance. |
@magento give me test instance |
Hi @krzksz. Thank you for your request. I'm working on Magento instance for you |
Hi @krzksz, here is your new Magento instance. |
@DrewML could you please take a look at the changes? |
FYI: it seems like some sections are not invalidated now property hence
failing tests, I'm looking into it.
pt., 4 paź 2019, 22:35 użytkownik Stanislav Idolov <notifications@github.com>
napisał:
… @DrewML <https://github.com/DrewML> could you please take a look on the
changes?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24847?email_source=notifications&email_token=AAGKOBONSAJNXKEADBDBMD3QM6SIXA5CNFSM4I5MNBP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAM2A6Y#issuecomment-538550395>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGKOBMZKXLP3GFI5T6ZXB3QM6SIXANCNFSM4I5MNBPQ>
.
|
Ok, it seems that everything is back to normal. Currently the only errors that are left are:
Please @DrewML and @paliarush what I should do with them. |
I'm a bit backed up with work at the moment, but tagging in @vzabaznov to try and get a review done. He's done a massive amount of investigation into |
Hi @krzksz, thank you for PR. |
Have we checked yet if using |
Hmm, I'm not sure what the actual approach should be, but I'm guessing we should try to provide the information via
Good point, will check. |
As suspected @vzabaznov I tried to figure it out but I still don't know how |
Hi @krzksz, thank you for your contribution! |
@magento give me 2.3-develop instance |
Hi @krzksz. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @krzksz, here is your Magento instance. |
I am closing this PR because its changes would do more damage then help. I decided to prepare a separate one where I'm covering both |
Hi @krzksz, thank you for your contribution! |
Based on magento/magento2#24847 and should fail in Magento 2.3.4
This pull request aims to fix all issues connected with the fact that the configuration of customer data and its sections is currently being passed through
x-magento-init
script block.Description (*)
The majority of information is already provided within #17125 and #23099. Because of the fact that both
customer-data.js
andsection-config.js
modules rely onx-magento-init
script to initialize them with configuration there are situations in which they can be required and evaluated by other modules before that actually happens which results in multiple errors e.g.:TypeError: sections is undefined
Uncaught TypeError: Cannot set property 'sectionLoadUrl' of undefined
TypeError: Cannot read property '*' of undefined
My initial idea was to pass mentioned configuration simply via a global variable but then I remembered that RequireJS actually has a build-in mechanism for that https://requirejs.org/docs/api.html#config-moduleconfig which I took advantage of. This pull request also makes changes within #23099 obsolete.
Fixed Issues (if relevant)
Manual testing scenarios (*)
TypeError: sections is undefined
is being thrown without this changes.Contribution checklist (*)