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

Saved Object Import UI - Multiple modals show up but there is no wait for user input (when input format is JSON) #75795

Closed
lucabelluccini opened this issue Aug 24, 2020 · 4 comments · Fixed by #76482
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@lucabelluccini
Copy link
Contributor

lucabelluccini commented Aug 24, 2020

Kibana version: 7.8.1, 7.9.0

Elasticsearch version: aligned

Browser version: Version 84.0.4147.135 (Official Build) (64-bit)

Browser OS version: MacOS Mojave 10.14.6 (18G4032)

Describe the bug:

Importing several objects in Saved Objects UI and disabling automatic overwrite.
If there are multiple objects to overwrite, the Kibana UI triggers multiple modals to prompt for cancel or overwrite but they cannot be used.
Only the last one is shown and Kibana keeps waiting for all the modals (no more visible).
This only happens when the data format is JSON (e.g. coming from 6.x)

Steps to reproduce:

  1. Install the Sample web logs in a Kibana 6.8
  2. Export some of the saved objects
  3. Go on a Kibana 7.8.1 or 7.9.0 (or earlier probably affected)
  4. Ensure the index patterns IDs used by the visualizations exported in (2) exist on this Kibana (create them forcing the same IDs)
  5. Go to Stack management / Saved Objects
  6. Import the file, enabling Automatically overwrite all saved objects?
  7. Import the file again, disabling Automatically overwrite all saved objects?
  8. Multiple prompts will appear, but the disappear immediately except one
  9. Answering the last modal will leave Kibana import process waiting

Expected behavior:

Wait for user input when asked to overwrite, as it seems to happen for NDJSON format.

Screenshots (if relevant):

saved object multiple modals

Errors in browser console (if relevant):

409 errors, but I think they're triggered when checking if it exists.

Any additional context:

This can happen when a user wants to replicate a behavior in different environments.

@lucabelluccini lucabelluccini added bug Fixes for quality problems that affect the customer experience Feature:Saved Objects labels Aug 24, 2020
@mshustov mshustov added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Aug 25, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@pgayvallet
Copy link
Contributor

Note that this is only happening when importing in the legacy (json) format. ndjson imports override confirmation popin is behaving correctly.

@pgayvallet
Copy link
Contributor

@lucabelluccini could you share the json export file you used to reproduce this issue?

@pgayvallet
Copy link
Contributor

Seems to be caused by the parallel work we are doing on the indexPattern import

await awaitEachItemInParallel(docTypes.indexPatterns, async (indexPatternDoc) => {
try {
const importedIndexPatternId = await importIndexPattern(
indexPatternDoc,
indexPatterns,
overwriteAll,
confirmModalPromise
);

All the conflicting indexPatterns resolutions are executed at the same time, causing all the confirmation modals to be opened at the same time. But as we only allow one modal at a time in

openConfirm: (message: MountPoint | string, options?: OverlayModalConfirmOptions) => {
// If there is an active modal, close it before opening a new one.
if (this.activeModal) {
this.activeModal.close();
this.cleanupDom();
}

All modals but the last are silently closed.

This is still surprising that the associated promises never get to resolve, as opening a modal should resolve the previous modal's promise.

But anyway, removing the awaitEachItemInParallel wrapper around importIndexPattern seems the easiest way to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Saved Objects Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
4 participants