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

Ensuring referential integrity for saved objects deleted from saved objects management #146044

Open
rudolf opened this issue Nov 22, 2022 · 2 comments
Labels
Feature:Saved Objects Management Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@rudolf
Copy link
Contributor

rudolf commented Nov 22, 2022

Deleting a saved object from saved objects management does not enforce referential integrity. That means when there's a parent to child or child to parent references, deleting the parent does not delete it's children.

Sometimes this is the desired behaviour, e.g. deleting a dashboard should not delete all the visualisations in the visualisations library references by this dashboard.

Other times this is undesired, like when a case is deleted we might want to delete all the cases-comments and cases-user-actions so that we don't leave "orphaned" objects which continuously accumalate but have no value.

When there's a parent to child reference, it's possible to delete the child leaving the parent in an inconsistent state. For instance deleting the data view used by a dashboard that effectively breaks the dashboard, although the impact of this change isn't obvious to the user performing the action.

Given that the correct action to take here very much depends on the domain of the plugin, this logic needs to be specified by the plugin.

There are a couple of options here:

  1. Move "delete saved object" out of the saved objects management UI and into the Application. Based on early mockups this seems like the direction Global Experience might want to take [Discuss] Expose import & export APIs for saved object  #143745
  2. Add a client-side onDelete hook
  3. Add a server-side onDelete hook
@rudolf rudolf added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Saved Objects Management labels Nov 22, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@drewdaemon
Copy link
Contributor

The need for this from the visualization team has been removed for now.

We have decided to save event annotation groups as single saved objects instead of a group object with multiple hidden children. Because of that decision, this task is no longer a blocker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Saved Objects Management Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

3 participants