Skip to content

[Canvas] Deleting the last extant page of a workbook throws #34458

Description

@monfera

Kibana version:
v6.7, master and likely, everything in between

Browser version:
Chrome Version 73.0.3683.86 (Official Build) (64-bit)

Browser OS version:
OS X 10.14.3

Original install method (e.g. download page, yum, from source, etc.):
From the repo

Describe the bug:
If the last existing page of a workbook is not empty, and is deleted, the app throws and the page has to be reloaded

Steps to reproduce:

  • Make an empty workbook
  • Add a shape element
  • Delete the single existing page
  • It throws

Screenshots (if relevant):
image

Errors in browser console (if relevant):
breaks on var thumb = original.cloneNode(true); in dom_preview.js - original is null (because the query selector didn't find the non-existing DOM node)

Triage notes:

It was discovered while testing #33702 but then found in master too.

Slide sorter rendering (PageManager / DomPreview): dom_preview.js#L22-L25 expects that upon a Redux state change such as a page addition, the DOM with the original page had been updated by the time we get to this querySelector. The large page is rendered in another path in the component tree (WorkpadPage) - what is it that ensures that the WorkpadPage component mounts earlier in the DOM than the corresponding DomPreview component? One of the last two (known) open issues in #33702 is a regression, apparently DomPreview tries to clone a DOM element (page) that hasn't yet been inserted in the DOM

Labels indicate detection (v6.7 and current master) and anything in between.

Activity

  1. elasticmachine commented on Apr 3, 2019

    @elasticmachine
    Contributor

    Pinging @elastic/kibana-canvas

  2. bhavyarm commented on Apr 3, 2019

    @bhavyarm
    Contributor

    I reproduced this on BC4(staging) of 7.0.0-RC2:
    Screen Shot 2019-04-03 at 12 44 17 PM

  3. monfera commented on Apr 3, 2019

    @monfera
    ContributorAuthor

    @cqliu1 we had a chat about this with @w33ble and agreed that with React, we can't take the DOM append order for granted, so the document.querySelector('#${this.props.elementId}'); needs to be in the update method, where it can just do nothing while it returns null and then do its thing when it's valid. Maybe there are alternatives like rendering currently not visible pages directly into the preview but React has no support for reparenting so... we could have a quick brainstorm at some point.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions