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

[M2P-161] Fix issue with IE11: cart total isn't shown under some condition #808

Merged
merged 1 commit into from
Jul 22, 2020

Conversation

vitaliyreznikov
Copy link
Collaborator

@vitaliyreznikov vitaliyreznikov commented Jul 21, 2020

Description

Please include a summary of the change and which issue is fixed. Include the motivation for the changes, and comment on your PR if necessary for clarity.

An issue was introduced in #801 (2.10.0)
After this PR it's possible that we use Magento sections functional before it initialized properly.
It happens on cart page only, when Magento tried to render order total.
As a result, the order total isn't rendered. Bolt button is shown and it can work if bolt order was loaded before the issue happened.
If, for example, a user clicked add to cart, wait 10 seconds and then go to cart page we can expect bolt button works.
If a user goes to the cart page right after they added something to the cart bolt button doesn't work.
If the bolt button doesn't work, we don't show any error, just nothing happens when clicking it.
Page reload fixes the issue.

The issue doesn't happen on Magento >= 2.3.3, because some sort of protection was introduced

Usually, the issue shouldn't happen because sections initialized even if we didn't check it.
We are able to reproduce the issue on IE11 only, but we can't be sure it doesn't happen on other envs.
This is a race condition issue, so it doesn't happen on IE11 each time, only sometimes.

#changelog [M2P-161] Fix issue with IE11: cart total isn't shown under some condition

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please validate that you have tested your change in at least one of the following areas:

  • Successfully tested locally (or docker image)
  • Successfully tested on a staging or sandbox server
  • Successfully tested on a merchant's staging server

For PR Reviewer

  • Reviewed unit tests to make sure we are using real components rather than mocks as much as possible?
  • For any major change (observer, new Bolt feature, core Magento interaction) we must add a feature switch, did you verify this?

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • New and existing unit tests pass locally with my changes.
  • I have created or modified unit tests to sufficiently cover my changes.
  • I have added my Jira ticket link and provided a changelog message.

@njfaries
Copy link
Contributor

If I'm following this right: this fix is just forcing the page to wait for the customer_data to be initialized?

Copy link
Contributor

@matt-thomason matt-thomason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify the fix @vitaliyreznikov? See @njfaries comment above

@vitaliyreznikov
Copy link
Collaborator Author

Yes, that's correct. Before this PR customer_data can be initialized in the wrong way. It needs to receive parameters for the constructor via phtml file (x-magento-init) - https://github.com/magento/magento2/blob/9544fb243d5848a497d4ea7b88e08609376ac39e/app/code/Magento/Customer/view/frontend/templates/js/customer-data.phtml

And before this PR it's possible that customer_data doesn't receive parameters and it produces the issue.

@vitaliyreznikov
Copy link
Collaborator Author

So I just partially revert this one #801 to fix the isssue.

Copy link
Contributor

@matt-thomason matt-thomason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, thanks for the explanation.

Copy link
Contributor

@njfaries njfaries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation makes sense, thanks.

@vitaliyreznikov vitaliyreznikov merged commit 4b58645 into master Jul 22, 2020
@vitaliyreznikov vitaliyreznikov deleted the vitaliy/ie11-total-fix branch July 22, 2020 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants