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

Introduce automatic cleanup of related saved objects #4499

Open
ohltyler opened this issue Jul 5, 2023 · 2 comments
Open

Introduce automatic cleanup of related saved objects #4499

ohltyler opened this issue Jul 5, 2023 · 2 comments
Assignees

Comments

@ohltyler
Copy link
Member

ohltyler commented Jul 5, 2023

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: #4059

Some immediate limitations of this solution is:

  • the trigger added in saved_objects_management should be maintained in saved_objects. This is the more logical location, and also can remove adding this dependency to other plugins that are listening for the trigger.
  • no corresponding UX. It is done behind-the-scenes.
  • only applicable in certain situations. It is currently only used when deleting visualizations under certain UX flows, or when rendering a visualization embeddable behind-the-scenes. See linked issue for more details

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.

@ohltyler
Copy link
Member Author

ohltyler commented Jul 5, 2023

Reference: #4361 (comment)

@ohltyler ohltyler changed the title [Vis Augmenter] Refactor dependencies in visualize plugin Introduce automatic cleanup of related saved objects Jul 6, 2023
@kavilla
Copy link
Member

kavilla commented Jul 9, 2023

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:

  • In the state of exporting the saved object without the related object then importing it will mark it in the stale state as well.
  • In the state where the viz was deleted but the user wanted to recover the viz will now require to restoring of the related saved objects.
  • In the state where the user are happy with their related saved objects but wanted to change their visualization type.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants