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

[Maps] fix multi-select query from Controls visualization not always getting applied to map in dashboard #87310

Merged
merged 4 commits into from Jan 7, 2021

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Jan 5, 2021

Fixes #87301

Controls visualization makes 2 changes to filterManager. The first change removes the existing filter for the control, while the second change creates the new filter. This resulted in MapEmbeddable.onContainerStateChanged getting called twice, once with empty filters and once with the actual filter. This resulted in the search without the filter.

Lens and visualize embeddables where not effected by this and where not getting called with the empty filter state. Looking into those embeddables, they subscribe to getUpdated$ instead of getInput$ to listen for changes. getUpdate is just a debounce wrapper around getInput. This PR resolves the issue by subscribing to changes with getUpdated$ like lens and visualize embeddable.

Having 2 filter changes exposed a bug in blended vector layer. The original request to fetch the number of documents in view should be aborted when the second request starts. When aborted, the original request should exit sync data. Blended layer has a bug where "count" requests do not register a callback. Thus, when the second request starts, the first request is not aborted and continues to sync data. This PR also addressed this problem and registers an abort signal for the "count" request.

Finally, endDataLoad was updated to throw a DataRequestAbortError when processing the response to an outdated request. While blended layer had a bug, there should be good logic in redux store actions to ensure the response is for the active request. This check would have prevented the entire problem.

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@nreese
Copy link
Contributor Author

nreese commented Jan 7, 2021

@elasticmachine merge upstream

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

thank your for fixing both the original issue, but also making the data-loading more robust.

tested and works.

dispatch: ThunkDispatch<MapStoreState, void, AnyAction>,
getState: () => MapStoreState
) => {
dispatch(unregisterCancelCallback(requestToken));
const dataRequest = getDataRequestDescriptor(getState(), layerId, dataId);
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
maps 2.8MB 2.8MB +66.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nreese nreese merged commit 8cb6226 into elastic:master Jan 7, 2021
nreese added a commit to nreese/kibana that referenced this pull request Jan 7, 2021
…getting applied to map in dashboard (elastic#87310)

* [Maps] fix multi-select query from Controls visualization not always getting applied to map in dashboard

* fix underlying problem in blended layer

* clean-up

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
nreese added a commit to nreese/kibana that referenced this pull request Jan 7, 2021
…getting applied to map in dashboard (elastic#87310)

* [Maps] fix multi-select query from Controls visualization not always getting applied to map in dashboard

* fix underlying problem in blended layer

* clean-up

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
nreese added a commit that referenced this pull request Jan 7, 2021
…getting applied to map in dashboard (#87310) (#87687)

* [Maps] fix multi-select query from Controls visualization not always getting applied to map in dashboard

* fix underlying problem in blended layer

* clean-up

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
nreese added a commit that referenced this pull request Jan 7, 2021
…getting applied to map in dashboard (#87310) (#87688)

* [Maps] fix multi-select query from Controls visualization not always getting applied to map in dashboard

* fix underlying problem in blended layer

* clean-up

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
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.

[Maps] multi-select query from Controls visualization not always getting applied to map in dashboard
4 participants