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

fix(@aws-amplify/analytics): avoid return statement in the beforeunload function #2180

Merged
merged 3 commits into from
Nov 29, 2018

Conversation

powerful23
Copy link
Contributor

Issue #, if available:
fixes #2088
In the compiled js file, there will be a return statement if the function is async which will cause the issue. By eliminating the async should fix it.
Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ghost ghost assigned powerful23 Nov 22, 2018
@ghost ghost added the review label Nov 22, 2018
Copy link
Contributor

@manueliglesias manueliglesias left a comment

Choose a reason for hiding this comment

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

Doing async stuff inside the beforeunload is not guaranteed to complete/succeed.

window.addEventListener("beforeunload", this._trackBeforeUnload, false);

We need to explore better approaches for the future (e.g. service workers)

Approving as to help people using IE11

@powerful23
Copy link
Contributor Author

@manueliglesias Agree.

@powerful23 powerful23 merged commit 689b090 into aws-amplify:master Nov 29, 2018
@ghost ghost removed the review label Nov 29, 2018
@powerful23 powerful23 deleted the fix-issue-2088 branch March 4, 2019 22:38
@github-actions
Copy link

This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IE11 beforeunload causes system alert popup
2 participants