Open ohltyler opened 1 year ago
I think we should consider a UX feature. One consistent work flow is that references are deleted but the actual object is still available. For example, I can delete a dashboard but it wont delete all my visualizations if those visualizations aren't attached to a dashboard anymore. Same with filters and index patterns.
Cases to think about here too:
stale
state as well.So I think it would be better to give the user the option and if they decline then they have the ability to tag something as stale
or isolated
related saved object.
Problem
Currently, there is nothing done to remove or update saved objects, when a related/dependent one is removed. For example, removing an index pattern can have downstream effects that break visualizations, and potentially dashboards where those visualizations may be embedded.
The current (partial) solution
The Vis Augmenter / Feature Anywhere feature had a hard requirement to provide some sort of cleanup of the
augment-vis
saved objects when there was changes to the related plugin resources, or if the related visualization was deleted. Due to the nature of the feature and the easy potential for there to be lots of stale saved objects, as well as other UX-related flows such as preventing lots of errors showing up when rendering dashboards, an auto-deletion solution was implemented. See details here: #4059Some immediate limitations of this solution is:
saved_objects_management
should be maintained insaved_objects
. This is the more logical location, and also can remove adding this dependency to other plugins that are listening for the trigger.TODOs have been added in source code highlighting the main locations where the current implementation can be improved upon, and linking back to this issue.
This solution is sufficient for this feature, but it should be expanded upon
Proposal
There should be a generic framework that all saved objects can use to provide automatic cleanup when an object is deleted, as well as related UX for transparency on the downstream effects of deleting certain saved objects, and options to automatically delete or update them as well. This could be done via some modal or other way that would show when a saved obj is deleted through any of the existing UX flows.