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

[BUG] addHousekeepingBeforeUnload should also be listening to the 'unload' event #1517

Closed
MSNev opened this issue Mar 30, 2021 · 2 comments
Closed

Comments

@MSNev
Copy link
Collaborator

MSNev commented Mar 30, 2021

Add and export the following helper to listen for all "unload" / "navigate" events

export function addPageUnloadEventListener(listener: any): boolean {
    // Hook the unload event for the document, window and body to ensure that the client events are flushed to the server
    // As just hooking the window does not always fire (on chrome) for page navigations.
    let pageUnloadAdded = addEventHandler("beforeunload", listener);
    pageUnloadAdded = addEventHandler("unload", listener) || pageUnloadAdded;
    pageUnloadAdded = addEventHandler("pagehide", listener) || pageUnloadAdded;
    return pageUnloadAdded;
}

And update addHousekeepingBeforeUnload() in AISKU/Initialization.ts to use it

@MSNev MSNev self-assigned this Mar 30, 2021
@MSNev MSNev assigned xiao-lix and unassigned MSNev Apr 14, 2021
@MSNev MSNev added this to the 2.x.x (Next Release) milestone Apr 15, 2021
xiao-lix added a commit that referenced this issue Apr 16, 2021
…snippet (#1532)

* bug fix - add unload listener and initialize missing config items

* remove unnecessary initializations and pass in config to getDefault method

* add correlationHeaderExcludePatterns default value

* fix test
@xiao-lix xiao-lix added the fixed - waiting release PR Committed and waiting deployment label Apr 16, 2021
@MSNev
Copy link
Collaborator Author

MSNev commented Apr 27, 2021

v2.6.2 is now fully deployed

@MSNev MSNev closed this as completed Apr 27, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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

No branches or pull requests

2 participants