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

Filtering on a search cell first inclusive then exclusive gives bad results - #39802 #41754

Merged
merged 6 commits into from
Jul 24, 2019

Conversation

lizozom
Copy link
Contributor

@lizozom lizozom commented Jul 23, 2019

Summary

Resolves
#39802
#41762

The problem was happening due to FilterManager exposing it's internal filters array.
When a filter was manipulated, it was updated in FilterManager directly, without detecting changes and triggering UI updates.

Now FilterManager returns a clone of the filters array, and if a filter is changed, setFilters or addFilters must be called to reflect the changes.

I also updated the test that didn't detect the problem and 2 other tests that has the same issue.

Checklist

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

For maintainers

@lizozom lizozom added bug Fixes for quality problems that affect the customer experience v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.3.0 v7.4.0 :AppArch labels Jul 23, 2019
@lizozom lizozom self-assigned this Jul 23, 2019
@lizozom lizozom added the review label Jul 23, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@lizozom
Copy link
Contributor Author

lizozom commented Jul 23, 2019

The changes in this PR essentially are:

  1. clone filters before returning them from filter manager
  2. filter generator to push existing into newFilters array. It relies on the dedup login in filter manager to make sure the right one is persisted.
  3. Update filter generator tests to know that it now uses addFilters for invertFilters
  4. Update filter manager tests that didn't detect the bug in the first place
  5. Add two undefined checks in the code

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

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

lgtm. Pulled down and tested prior to the last push, bug was fixed. Like this version better with no invertFilters fn. 🎉

Copy link
Member

@ppisljar ppisljar 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

@lizozom lizozom merged commit 17ad42f into elastic:master Jul 24, 2019
lizozom pushed a commit to lizozom/kibana that referenced this pull request Jul 24, 2019
…esults - elastic#39802 (elastic#41754)

* Resolves elastic#39802

* Fixed tests that didn't detect the bug

* Don't expose filter manager's filters, but a copy.

* getPartitionedFilters to use getFilters (for clone)

* Adjust filter gen tests to invert filters now calling addFilters

* remove invertFilter method
lizozom pushed a commit to lizozom/kibana that referenced this pull request Jul 24, 2019
…esults - elastic#39802 (elastic#41754)

* Resolves elastic#39802

* Fixed tests that didn't detect the bug

* Don't expose filter manager's filters, but a copy.

* getPartitionedFilters to use getFilters (for clone)

* Adjust filter gen tests to invert filters now calling addFilters

* remove invertFilter method
lizozom pushed a commit that referenced this pull request Jul 24, 2019
…esults - #39802 (#41754) (#41857)

* Resolves #39802

* Fixed tests that didn't detect the bug

* Don't expose filter manager's filters, but a copy.

* getPartitionedFilters to use getFilters (for clone)

* Adjust filter gen tests to invert filters now calling addFilters

* remove invertFilter method
lizozom pushed a commit that referenced this pull request Jul 24, 2019
…esults - #39802 (#41754) (#41859)

* Resolves #39802

* Fixed tests that didn't detect the bug

* Don't expose filter manager's filters, but a copy.

* getPartitionedFilters to use getFilters (for clone)

* Adjust filter gen tests to invert filters now calling addFilters

* remove invertFilter method
@lizozom lizozom deleted the bug/39802/discover-filter-out-value branch November 14, 2019 13:04
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 review v7.3.0 v7.4.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants