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

Filter manager improvements \ bug fixes #41999

Conversation

lizozom
Copy link
Contributor

@lizozom lizozom commented Jul 25, 2019

Summary

Related to issues #41144 and #41204

Bugfix - Update and fetch events fired twice

  • Avoid firing update \ fetch events twice from filter manager, by making filter state manager use getFilters rathrer than storing filters in its own state.
  • Added test that reproduced this bug.

Optimization - don't fetch data when changing disabled filters

  • Don't fire fetch event when only disabled filters were changed
  • Added test that validates this behavior.

onlyDisabledChanged implementation

  • Changed onlyDisabledChanged implementation to a more readable one (in TS).
  • Moved onlyDisabledChanged tests to jest.
  • Exported onlyDisabledChanged from data plugin, for any other plugin to use
  • Deleted unused onlyStateChanged helper

Summarize your PR. If it involves visual changes include a screenshot or gif.

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

 - Avoid firing update \ fetch events twice from filter manager, by making filter state manager use getFilters rathre than storing its own previous filters.
- Don't fire fetch event when only disabled filters were changed
- Replaced onlyDisabledChanged implementation with a more readable one (karma tests pass!)
- Exported onlyDisabledChanged from data
- Deleted unused only_state_changed
@lizozom lizozom self-assigned this Jul 25, 2019
@lizozom lizozom added release_note:skip Skip the PR/issue when compiling release notes Team:AppArch v7.3.0 v7.4.0 v8.0.0 labels Jul 25, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch

@lizozom lizozom added the bug Fixes for quality problems that affect the customer experience label Jul 25, 2019
@ppisljar
Copy link
Member

ppisljar commented Jul 25, 2019

it seems it doesn't fix #41204, i can still replicate that bug (go to visualize, open visualization, open dev tools, go to network tab, click refresh. two msearch requests are fired. appart from that LGTM, tested on chrome linux

@lizozom
Copy link
Contributor Author

lizozom commented Jul 25, 2019

@ppisljar, spoke with @lukasolson
This PR solves one half of the problem, and he has the other half in his PR.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@lizozom
Copy link
Contributor Author

lizozom commented Jul 26, 2019

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@lizozom
Copy link
Contributor Author

lizozom commented Jul 26, 2019

@ppisljar, @lukasolson updated his PR, to depend on this one and fix the bug in #41204.
Let me know if you have any comments or suggested changes

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

Code LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@lizozom lizozom merged commit f5ad6ad into elastic:master Jul 28, 2019
lizozom pushed a commit to lizozom/kibana that referenced this pull request Jul 28, 2019
* Filter manager improvements

 - Avoid firing update \ fetch events twice from filter manager, by making filter state manager use getFilters rathre than storing its own previous filters.
- Don't fire fetch event when only disabled filters were changed
- Replaced onlyDisabledChanged implementation with a more readable one (karma tests pass!)
- Exported onlyDisabledChanged from data
- Deleted unused only_state_changed

* Delete empty afterEach
lizozom pushed a commit that referenced this pull request Jul 28, 2019
* Filter manager improvements

 - Avoid firing update \ fetch events twice from filter manager, by making filter state manager use getFilters rathre than storing its own previous filters.
- Don't fire fetch event when only disabled filters were changed
- Replaced onlyDisabledChanged implementation with a more readable one (karma tests pass!)
- Exported onlyDisabledChanged from data
- Deleted unused only_state_changed

* Delete empty afterEach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes v7.3.1 v7.4.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants