AC-11717 Dont throw console error for customer data if the request is… #39509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (*)
Don't throw error from customer-data.js if the request is cancelled or blocked by browser.
After clicking login button in checkout page, magneto calls customer load section two times with different sections
first request -> /customer/section/load/?sections=cart%2Ccaptcha%2Cmessages&force_new_section_timestamp=true&_=1735042507664
sections = cart, messages, captcha
second request -> /customer/section/load/?sections=cart%2Cdirectory-data%2Ccustomer%2Ccaptcha%2Ccompare-products%2Clast-ordered-items%2Cinstant-purchase%2CloggedAsCustomer%2Cpersistent%2Creview%2Cwishlist%2Crecently_viewed_product%2Crecently_compared_product%2Cproduct_data_storage%2Cpaypal-billing-agreement%2Cpaypal-buyer-country%2Cmessages&force_new_section_timestamp=false&_=1735042522007
second request also have cart, messages & captcha. I think Firefox is optimize network usage by canceling or blocking the first request if it determines that the subsequent request will provide a superset of the required data (cart, captcha, messages, and more). so its blocked/cancelled the first request and executes the second request.
I added a if condition to not throw any error if status code is zero.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Note: Enable the below config to show password field for guest checkout, if the email is found
Questions or comments
Contribution checklist (*)