-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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: race condition in livechat popout mode cross origin #34158
Conversation
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: eb4dc8c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #34158 +/- ##
========================================
Coverage 75.81% 75.81%
========================================
Files 512 512
Lines 22208 22208
Branches 5404 5404
========================================
Hits 16837 16837
Misses 4720 4720
Partials 651 651
Flags with carried forward coverage won't be shown. Click here to find out more. |
Proposed changes (including videos or screenshots)
We had an issue that caused the livechat popout mode to not work when in cross domains, this fix was developed #33944 but it had a race condition issue, trying to use window.postMessage() right after window.open() does not guarantee that the message will be received, and assuring that the page has loaded in cross domains can be very finicky, so I changed the approach to use the
checkPoppedOutWindow
callback to properly register the guest to the popover using something similar to thesetGuestToken
livechat api callIssue(s)
SUP-708
Steps to test or reproduce
A good way to test this issue is to disable the registration form, that can cause the popover to have different tokens