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

[EuiPopover] Fix removeEventListener with mismatched capture flag #5437

Merged
merged 3 commits into from
Dec 3, 2021

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Dec 2, 2021

Summary

Per MDN: 'Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.'

closes #5435

This is causing a memory leak for Kibana (elastic/kibana#120251), so we'll likely need to backport this to 7.16 and 8.0

Checklist

  • A changelog entry exists and is marked appropriately

Per MDN: 'Removal of a capturing listener does not affect a non-capturing version of the same listener, and vice versa.'
@cee-chen cee-chen force-pushed the eui-popover-memory-leak branch from 9368e1b to 993ecaa Compare December 2, 2021 18:22
@cee-chen cee-chen removed the !urgent! label Dec 2, 2021
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5437/

@cee-chen
Copy link
Contributor Author

cee-chen commented Dec 2, 2021

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5437/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

Thanks, @constancecchen!

I did a quick quick JS memory trial to verify cleanup:

Screen Shot 2021-12-03 at 9 16 47 AM

After a series of navigation to and away from the popover page:

  • The current release continuously increased live memory and never recovered the gain
  • The new/fixed version increased live memory but also recovered at each cycle

@cee-chen
Copy link
Contributor Author

cee-chen commented Dec 3, 2021

@thompsongl if you don't mind I'd actually love to see a screencap/video of how you did that! I fiddled a bit in the memory tab of Firefox but got confused 🙈

@cee-chen cee-chen enabled auto-merge (squash) December 3, 2021 16:58
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5437/

@cee-chen cee-chen merged commit 611a18f into elastic:main Dec 3, 2021
@cee-chen cee-chen deleted the eui-popover-memory-leak branch December 3, 2021 17:46
@diegozubieta95 diegozubieta95 mentioned this pull request Mar 24, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EuiPopover] positionPopoverFixed memory leak
3 participants