zui icon indicating copy to clipboard operation
zui copied to clipboard

Dragging a query folder to the bottom makes it disappear & breaks further operations

Open philrz opened this issue 3 years ago • 1 comments

Repro is with Brim commit 24d658. This issue seems somewhat similar in spirit to #1906.

Repro steps as shown in the attached video:

  1. Drag the Brimcap Queries folder into the app
  2. Make a new folder and add a query into it
  3. Drag the new folder to become the bottom entry under the Brimcap folder
  4. Drag the new folder just below the bottom of the Brimcap folder entries

At that last step, the new folder disappears from the interface and the following error appears in DevTools:

Uncaught TypeError: Cannot read properties of undefined (reading 'model')
    at /Users/phil/work/brim/dist/js/state/Queries/reducer.js:64
    at immerClass.ts:80
    at Immer.produce (immerClass.ts:96)
    at curriedProduce (immerClass.ts:80)
    at combination (/Users/phil/work/brim/node_modules/redux/lib/redux.js:465)
    at k (<anonymous>:2235:16)
    at D (<anonymous>:2251:13)
    at <anonymous>:2464:20
    at Object.dispatch (/Users/phil/work/brim/node_modules/redux/lib/redux.js:219)
    at e (<anonymous>:2494:20)

Further attempts to do operations in the query library do not succeed, and DevTools keeps getting spammed with errors like:

Uncaught Invariant Violation: Cannot call hover after drop.
    at invariant (/Users/phil/work/brim/node_modules/@react-dnd/invariant/dist/invariant.cjs.development.js:31:15)
    at checkInvariants (/Users/phil/work/brim/node_modules/dnd-core/dist/cjs/actions/dragDrop/hover.js:43:28)
    at DragDropManagerImpl.hover (/Users/phil/work/brim/node_modules/dnd-core/dist/cjs/actions/dragDrop/hover.js:23:5)
    at Object.hover (/Users/phil/work/brim/node_modules/dnd-core/dist/cjs/classes/DragDropManagerImpl.js:86:38)
    at /Users/phil/work/brim/node_modules/react-dnd-html5-backend/dist/cjs/HTML5BackendImpl.js:271:23

https://user-images.githubusercontent.com/5934157/191072309-ebee4519-d41d-4778-9b4b-bd33c6111893.mp4

philrz avatar Sep 19 '22 17:09 philrz

Thanks for reporting.

jameskerr avatar Sep 21 '22 17:09 jameskerr

Verified in Brim commit a6fc1a8.

As shown in the attached video, now we see success with all attempts to move the new folder into the zone that previously caused it to disappear. The line that appears as a drag destination either causes it to land in the same spot or one level up.

https://user-images.githubusercontent.com/5934157/203457886-cae2aac2-57fa-4d8d-95e4-4f8911ccb15c.mp4

Thanks @jameskerr!

philrz avatar Nov 23 '22 02:11 philrz