Repository navigation
Fix map updates not propagating to the dashboard - #13589
stacey-gammon merged 17 commits into
Conversation
6c66651 to
0fe1e5c
Compare
0fe1e5c to
0c62545
Compare
|
@stacey-gammon This change breaks the There needs to be additional Additionally, it would be nice if the geo_centroid aggregation is tested to verify it is turned on/off when using setting the |
…g temporary "sessionState" on a vis
|
thanks Stacey! seems to work OK the failing test is probably due to not after you toggle the checkbox |
| const boundingBox = {}; | ||
| delete mapCollar.zoom; // zoom is not part of bounding box filter | ||
| boundingBox[agg.getField().name] = mapCollar; | ||
| vis.sessionState.mapCollar = mapCollar; |
There was a problem hiding this comment.
A new _msearch request is created anytime the aggregation changes. By updating the mapCollar every time, the aggregation changes any time the map is moved. This results in an _msearch request on each map movement which is not the intended behavior.
vis.sessionState.mapCollar should only be updated when the mapBounds are outside of the last fetched map collar and new data needs to be fetched from elasticsearch.
add more tests to ensure getRequestAggs functions as intented
|
Failed on: |
…ap-overriding-dashboard-state
|
Couple issues going on with the latest implementation:
@nreese, @ppisljar - I think we should just update the data used in the test to match the new results, and live with the fact that mapCollar is recalculated on a page refresh/url change. What do you guys think? |
|
@stacey-gammon I think its a good idea to update the test data. It makes sense that the mapCollar is recalculated on page refresh/url change. Since fresh data is being requested from ES, then this is an improvement over the old implementation since now the mapCollar is re-centered around the map when data is first pulled. |
I think because mapCollar is no longer saved in uiState, the save recenters the data and we get slightly different data points from the test data. As far as my eye can tell, everything is working as intended.
|
I think there might be something else going on. I updated the data, but it still doesn't work. The test checks that the data goes from A -> B and back to A after zooming back out. Now it seems to go to A' -> B -> A (back to the original A data from the original test, not A'). This doesn't quite make sense. I'll have to dig more into it. |
…ap-overriding-dashboard-state
|
I think the problem is that we assume a visualization plugin's request has no dependency on the visualization UI, but this is not the case with tile maps. What happens on master is that a request is made to es, with no map collar. The visualization is rendered, the map bounds are updated in uistate, this triggers a new es request, and a second request is made with the map collar filter applied this time. Because in this PR I'm not storing the map bounds in the ui state anymore, this doesn't trigger the second es request. Few ways I can think to fix this:
@ppisljar - you are probably the most familiar with the visualization plugin system. Do you have any ideas about the above? Ideally we'd be able to fix this by having all the required information before the first request goes out to es so we aren't unnecessarily sending an extra request. cc @nreese |
|
|
i've put a PR up which introduces point 1. from above #13742 |
…ap-overriding-dashboard-state
- incorporate the new init function which fixes the bug where we lose map bounds data on a fresh save - add a test that would have caught that - adjust tests due to bug where map bounds is changing slightly. File another issue for that separately as it doesn’t actually affect the users map experience.
ccd1d97 to
7dea2b9
Compare
2b8351a to
ef591ec
Compare
…eve circles anymore
I suspect because the page is changing, you have to keep fetching the element afresh. I don’t see this error on my local but saw it on jenkins.
e3b46b9 to
b914c5d
Compare
…ap-overriding-dashboard-state
The function is used in the Data Table visualization where the spy pane select doesn’t exist.
|
jenkins, test this |
|
jenkins, test this issue in ES broke master builds, esvm should be rolled back now. |
|
s3 publish error jenkins, test this |
* Add failing tests * Add fix by preventing uiState from being directly updated in visualization. * Add test that would catch error caused by this PR in regards to filter agg * Fix issue with uiState triggering dirty dashboard state by introducing temporary "sessionState" on a vis * Click go after toggling the switch * add more tests to ensure getRequestAggs functions as intented * Go back to old zoom calculations. Update vis test data I think because mapCollar is no longer saved in uiState, the save recenters the data and we get slightly different data points from the test data. As far as my eye can tell, everything is working as intended. * fixes and tests - incorporate the new init function which fixes the bug where we lose map bounds data on a fresh save - add a test that would have caught that - adjust tests due to bug where map bounds is changing slightly. File another issue for that separately as it doesn’t actually affect the users map experience. * Fix tests Tests relied on my original logic of defaulting to the saved zoom state and not relying on uiState, so I went back to that logic. Also found another bug where mapZoom of 0 was being considered invalid, but it is actually a valid zoom level. * Since leaflet upgrade 'path.leaflet-clickable' can't be used to retrieve circles anymore * Avoid stale element reference I suspect because the page is changing, you have to keep fetching the element afresh. I don’t see this error on my local but saw it on jenkins. * remove spy select from PageObjects.visualize.getDataTableData The function is used in the Data Table visualization where the spy pane select doesn’t exist.
* Add failing tests * Add fix by preventing uiState from being directly updated in visualization. * Add test that would catch error caused by this PR in regards to filter agg * Fix issue with uiState triggering dirty dashboard state by introducing temporary "sessionState" on a vis * Click go after toggling the switch * add more tests to ensure getRequestAggs functions as intented * Go back to old zoom calculations. Update vis test data I think because mapCollar is no longer saved in uiState, the save recenters the data and we get slightly different data points from the test data. As far as my eye can tell, everything is working as intended. * fixes and tests - incorporate the new init function which fixes the bug where we lose map bounds data on a fresh save - add a test that would have caught that - adjust tests due to bug where map bounds is changing slightly. File another issue for that separately as it doesn’t actually affect the users map experience. * Fix tests Tests relied on my original logic of defaulting to the saved zoom state and not relying on uiState, so I went back to that logic. Also found another bug where mapZoom of 0 was being considered invalid, but it is actually a valid zoom level. * Since leaflet upgrade 'path.leaflet-clickable' can't be used to retrieve circles anymore * Avoid stale element reference I suspect because the page is changing, you have to keep fetching the element afresh. I don’t see this error on my local but saw it on jenkins. * remove spy select from PageObjects.visualize.getDataTableData The function is used in the Data Table visualization where the spy pane select doesn’t exist.
* Add failing tests * Add fix by preventing uiState from being directly updated in visualization. * Add test that would catch error caused by this PR in regards to filter agg * Fix issue with uiState triggering dirty dashboard state by introducing temporary "sessionState" on a vis * Click go after toggling the switch * add more tests to ensure getRequestAggs functions as intented * Go back to old zoom calculations. Update vis test data I think because mapCollar is no longer saved in uiState, the save recenters the data and we get slightly different data points from the test data. As far as my eye can tell, everything is working as intended. * fixes and tests - incorporate the new init function which fixes the bug where we lose map bounds data on a fresh save - add a test that would have caught that - adjust tests due to bug where map bounds is changing slightly. File another issue for that separately as it doesn’t actually affect the users map experience. * Fix tests Tests relied on my original logic of defaulting to the saved zoom state and not relying on uiState, so I went back to that logic. Also found another bug where mapZoom of 0 was being considered invalid, but it is actually a valid zoom level. * Since leaflet upgrade 'path.leaflet-clickable' can't be used to retrieve circles anymore * Avoid stale element reference I suspect because the page is changing, you have to keep fetching the element afresh. I don’t see this error on my local but saw it on jenkins. * remove spy select from PageObjects.visualize.getDataTableData The function is used in the Data Table visualization where the spy pane select doesn’t exist.
* Add failing tests * Add fix by preventing uiState from being directly updated in visualization. * Add test that would catch error caused by this PR in regards to filter agg * Fix issue with uiState triggering dirty dashboard state by introducing temporary "sessionState" on a vis * Click go after toggling the switch * add more tests to ensure getRequestAggs functions as intented * Go back to old zoom calculations. Update vis test data I think because mapCollar is no longer saved in uiState, the save recenters the data and we get slightly different data points from the test data. As far as my eye can tell, everything is working as intended. * fixes and tests - incorporate the new init function which fixes the bug where we lose map bounds data on a fresh save - add a test that would have caught that - adjust tests due to bug where map bounds is changing slightly. File another issue for that separately as it doesn’t actually affect the users map experience. * Fix tests Tests relied on my original logic of defaulting to the saved zoom state and not relying on uiState, so I went back to that logic. Also found another bug where mapZoom of 0 was being considered invalid, but it is actually a valid zoom level. * Since leaflet upgrade 'path.leaflet-clickable' can't be used to retrieve circles anymore * Avoid stale element reference I suspect because the page is changing, you have to keep fetching the element afresh. I don’t see this error on my local but saw it on jenkins. * remove spy select from PageObjects.visualize.getDataTableData The function is used in the Data Table visualization where the spy pane select doesn’t exist.
* Add failing tests * Add fix by preventing uiState from being directly updated in visualization. * Add test that would catch error caused by this PR in regards to filter agg * Fix issue with uiState triggering dirty dashboard state by introducing temporary "sessionState" on a vis * Click go after toggling the switch * add more tests to ensure getRequestAggs functions as intented * Go back to old zoom calculations. Update vis test data I think because mapCollar is no longer saved in uiState, the save recenters the data and we get slightly different data points from the test data. As far as my eye can tell, everything is working as intended. * fixes and tests - incorporate the new init function which fixes the bug where we lose map bounds data on a fresh save - add a test that would have caught that - adjust tests due to bug where map bounds is changing slightly. File another issue for that separately as it doesn’t actually affect the users map experience. * Fix tests Tests relied on my original logic of defaulting to the saved zoom state and not relying on uiState, so I went back to that logic. Also found another bug where mapZoom of 0 was being considered invalid, but it is actually a valid zoom level. * Since leaflet upgrade 'path.leaflet-clickable' can't be used to retrieve circles anymore * Avoid stale element reference I suspect because the page is changing, you have to keep fetching the element afresh. I don’t see this error on my local but saw it on jenkins. * remove spy select from PageObjects.visualize.getDataTableData The function is used in the Data Table visualization where the spy pane select doesn’t exist.
Fixes #13588