[Spaces] Share to spaces flyout swallows errors #171145
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Security/Spaces
Platform Security - Spaces feature
Team:Security
Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Describe the bug:
The Share to Space flyout calls1 the Update Objects Spaces API when adding or removing a shared object from Spaces. If the Promise rejects we catch the error and display appropriate toasts2.
However, the Update Objects Spaces API may return a successful response, but the objects array3 may have an errors key if the object was not able to be shared for some reason. The flyout does not verify the API response so even when there are errors the flyout will close and display a toast4 which erroneously reports the object(s) were successfully shared or unshared. Ideally we would check the API response to determine the appropriate toast messages.
IMO, this is not a critical bug, but it could become more prevalent as we start to make more saved objects shareable.
Steps to reproduce:
It does not seem likely that users could run into this bug in the
main
or release branches. But we have noticed it while adding the Spaces column to the other listing pages in theshareable-dashboards
feature branch.But with a slight change we can trigger this bug in `main.
namespaceType
on data views tomultiple-isolated
.SpacesList
component in the table and share the Kibana Sample Data Logs data view to another Space.Any additional context:
When we added the
SpacesList
component to the Visualize library listing page in theshareable-dashboards
feature branch we noticed that we could easily trigger this bug if any of the saved objects that could be listed there are not updated tonamespaceType: 'multiple'
.Footnotes
https://github.com/elastic/kibana/blob/49b488270e8b4395cf8a571280e3fc85fc2cb1cb/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.tsx#L121 ↩
https://github.com/elastic/kibana/blob/main/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.tsx#L347-L363 ↩
https://www.elastic.co/guide/en/kibana/current/spaces-api-update-objects-spaces.html#spaces-api-update-objects-spaces-response-body ↩
https://github.com/elastic/kibana/blob/main/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout_internal.tsx#L127-L160 ↩
The text was updated successfully, but these errors were encountered: