-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
SharingSavedObjectProps Injected into Dashboard Saved Object #119677
Comments
Pinging @elastic/kibana-presentation (Team:Presentation) |
Reverting changes to x-pack/plugins/lens/public/lens_attribute_service.ts and x-pack/plugins/maps/public/map_attribute_service.ts will cause problems with surfacing saved object loading conflicts. Both lens and maps use sharingSavedObjectProps to later handle conflicts and this state still needs to be passed along with saved object |
Hey Nathan, I originally thought that even after removing those changes, the saved object conflicts will still be surfaced, because the unwrap method is used for unlinking from the library and when the embeddable is by value that information isn't relevant. I know that the unwrap function is also used when loading an embeddable by reference, so it could be possible that simply removing those changes isn't enough. If that is the case, do you have any ideas on how to handle this? Maybe we need to handle unwrap differently depending on by value or by reference |
There are a couple of places where this issue can be resolved
|
I am also concerned this issue was not identified by typescript compile failures. AttributeService.getInputAsValueType returns type For MapAttributeService, SavedObjectAttributes is typed as
ValType is typed as
How come there are no typing errors when returning SavedObjectAttributes as MapByValueInput since MapByValueInput does not contain sharingSavedObjectProps? |
@ThomThomson and @nreese - what is the impact of |
It doesn't prevent dashboards from being viewed. The only tangible issue from the user's point of view is dashboards still showing the In terms of seriousness though, I'm generally very wary about issues that accidentally affect the structure of saved objects. That said, I am not sure this warrants a blocker. @jportner may also be interested in the discussion going on here. @nreese, great point about the typings not catching this, I will start there when I begin working on this. I think this is also intertwined with our earlier discussion about the |
@ThomThomson I share your generalized concern but given the concrete impact, it doesn't seem like it should be a blocker unless we're putting ourselves in a really bad position long-term. Do we have the option of using a saved-object migration to fix this behavior in a future version? |
Yes we do have that option. In that case, I also support removing this as a blocker. |
Awesome, thanks @ThomThomson |
Kibana version: 7.16.0
Describe the bug:
When a user unlinks a Map or Lens embeddable from the library, the
sharingSavedObjectProps
is injected into the attributes. This causes an unexpectedunsaved changes
badge on the dashboard, but also means thatsharingSavedObjectProps
is saved into the dashboard saved object.Steps to reproduce:
Expected behavior:
sharingSavedObjectProps
should never be saved into the saved objectCause:
The Maps & Lens attribute service unwrap methods were mistakenly modified in #112606 and #110059. This is because the saved object is loaded in order to unwrap it as part of the transformation to a by value saved object. When the saved object is loaded it also returns the
outcome
andalias
. These are mistakenly injected into the by value attributes of the panel. By Value panels should not havesharingSavedObjectProps
because they are not related to any saved object.Screenshots (if relevant):
Dashboard saved object with
savedObjectProps
:This should be fixed by reverting changes to
x-pack/plugins/lens/public/lens_attribute_service.ts
andx-pack/plugins/maps/public/map_attribute_service.ts
from the above PRs.The text was updated successfully, but these errors were encountered: