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(EventStack): fix erroneous removal of non-empty EventPool #2992

Merged
merged 5 commits into from
Jul 14, 2018

Conversation

mic4ael
Copy link
Contributor

@mic4ael mic4ael commented Jul 10, 2018

That fix avoids destruction of an EventPool in some cases which results in loss of some of the registered handlers.

Fixes #2905.
Fixes #2921.

@welcome
Copy link

welcome bot commented Jul 10, 2018

💖 Thanks for opening this pull request! 💖

Here is a list of things that will help get it across the finish line:

  • Run yarn lint locally to catch formatting errors. This will fix some errors automatically, commit and push any changes.
  • Run yarn test locally to catch errors. This ensures all components still behave as they should.
  • Run yarn start to run the doc site locally and try a few pages, ensuring everything is in good working order.
  • Include tests when adding/changing behavior.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@codecov-io
Copy link

codecov-io commented Jul 10, 2018

Codecov Report

Merging #2992 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2992   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files         163      163           
  Lines        2743     2743           
=======================================
  Hits         2742     2742           
  Misses          1        1

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 972b999...25c3eab. Read the comment docs.

@layershifter
Copy link
Member

I will review it today, need to test it.

@layershifter
Copy link
Member

@mic4ael does this fix an any existing issue?

@mic4ael
Copy link
Contributor Author

mic4ael commented Jul 10, 2018

@layershifter yes, Closes #2905

@layershifter
Copy link
Member

@mic4ael very cool ❤️

Oleksandr Fediashov added 2 commits July 10, 2018 13:04
Signed-off-by: Oleksandr Fediashov <[email protected]>
Signed-off-by: Oleksandr Fediashov <[email protected]>
if (handlerSet) return handlerSet.hasHandlers()
return false
hasHandlers() {
return this.handlerSets.size > 0
}
Copy link
Member

Choose a reason for hiding this comment

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

EventPool has handlers if it has any EventHandlerSet.

this.pools.delete(poolName)
}

this.removeTargetHandler(eventType)
Copy link
Member

Choose a reason for hiding this comment

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

We will need always to call removeTargetHandler().

this.pools.set(poolName, newPool)
} else {
this.removeTargetHandler(eventType)
this.pools.delete(poolName)
Copy link
Member

Choose a reason for hiding this comment

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

EventPool should not added if it's empty

@layershifter
Copy link
Member

@mic4ael I added some changes, can you please confirm that everything is okay?

@layershifter layershifter changed the title Event stack fix fix(EventStack): fix wrong removal of non-empty EventPool Jul 10, 2018
@layershifter layershifter changed the title fix(EventStack): fix wrong removal of non-empty EventPool fix(EventStack): fix erroneous removal of non-empty EventPool Jul 10, 2018
@mic4ael
Copy link
Contributor Author

mic4ael commented Jul 10, 2018

@layershifter yup, works fine ;)

@mic4ael
Copy link
Contributor Author

mic4ael commented Jul 10, 2018

@layershifter what is going on with the codecov/patch job? It has been stuck for quite some time

@layershifter
Copy link
Member

Sometimes it fails 🤔 Levi will merge this PR when he will have time.

@levithomason levithomason merged commit a9e0aae into Semantic-Org:master Jul 14, 2018
@welcome
Copy link

welcome bot commented Jul 14, 2018

Congrats on merging your first pull request! 🎉🎉🎉

robot victory dance

@levithomason
Copy link
Member

Really appreciate this fix. I know it took some real effort to grok the problem and solve the issue ❤️

@levithomason
Copy link
Member

Released in [email protected].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dropdown: do not close when clicked in succession Dropdowns misbehave when inside Popups
4 participants