Skip to content
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

AC-11717 Dont throw console error for customer data if the request is… #39509

Open
wants to merge 1 commit into
base: 2.4-develop
Choose a base branch
from

Conversation

Mohamed-Asar
Copy link
Contributor

@Mohamed-Asar Mohamed-Asar commented Dec 24, 2024

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)

  1. Fixes Magento 2 login inside the checkout with existing customer give console error in Firefox browser #38557 38557

Manual testing scenarios (*)

  1. Open Firefox browser
  2. Navigate to Store front as a guest user
  3. Go to product page from home page or via category page
  4. Add to cart a product
  5. Proceed to checkout via minicart or from the cart page
  6. Enter email address of an existing customer and then add password
  7. Click login button

Note: Enable the below config to show password field for guest checkout, if the email is found

image

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Copy link

m2-assistant bot commented Dec 24, 2024

Hi @Mohamed-Asar. Thank you for your contribution!
Here are some useful tips on how you can test your changes using Magento test environment.
❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names.

Allowed build names are:
  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here
ℹ️ Run only required test builds during development. Run all test builds before sending your pull request for review.


For more details, review the Code Contributions documentation.
Join Magento Community Engineering Slack and ask your questions in #github channel.

@m2-github-services m2-github-services added Partner: Ziffity partners-contribution Pull Request is created by Magento Partner labels Dec 24, 2024
@m2-community-project m2-community-project bot added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Dec 24, 2024
@Mohamed-Asar
Copy link
Contributor Author

@magento run all tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Partner: Ziffity partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: pending review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Magento 2 login inside the checkout with existing customer give console error in Firefox browser
2 participants