[Lens] Indexpattern datasource persistence issue layer not cleaned up #72855
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Lens
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
Kibana version: 7.9 BC2
Describe the bug:
It seems like when saving the state, sometimes old configuration makes its way back in.
Steps to reproduce:
Expected behavior:
Errors in browser console (if relevant):
Any additional context:
This is only happening when saving the visualization in between, when omitting step 3 everything works fine. It seems like there are two layers in the datasource with only one of them mapped to the visualization, causing issues.
The console error is caused by the pie renderer not finding the metric column (accessing id of undefined in the process). This happens because it's the wrong layer as the pie function just takes the first one out of the layer map, expecting it to be the only one (which it should be): https://github.com/flash1293/kibana/blob/f8ba824ebc7e3d551b791ba7b8c04f31cddcaf10/x-pack/plugins/lens/public/pie_visualization/render_function.tsx#L47
I suspect it's picking the wrong state at some point during serializing/deserializing
This is the saved object - it contains two layers instead of one, seems like the layer is not cleared up correctly:
The text was updated successfully, but these errors were encountered: