zadam / trilium

Build your personal knowledge base with Trilium Notes
GNU Affero General Public License v3.0
27.31k stars 1.91k forks source link

(Bug report) Fails to import file when dragging and dropping #2926

Open sigaloid opened 2 years ago

sigaloid commented 2 years ago

Trilium Version

0.52.3

What operating system are you using?

Other Linux

What is your setup?

Local + server sync

Operating System Version

Fedora 36

Description

JS Error: Cannot parse  into notes for drop
Stack: Error
    at N (http://127.0.0.1:37840/app-dist/desktop.js:2:103096)
    at Object.dragDrop (http://127.0.0.1:37840/app-dist/desktop.js:2:161296)
    at P.L (http://127.0.0.1:37840/libraries/fancytree/jquery.fancytree-all-deps.min.js:1:91573)
    at HTMLUListElement.dispatch (http://127.0.0.1:37840/libraries/jquery.min.js:2:43064)
    at HTMLUListElement.v.handle (http://127.0.0.1:37840/libraries/jquery.min.js:2:41048)

It seems like it depends where I drop it though because I dropped it in a different folder it seems to work okay.

zadam commented 2 years ago

Hi, is this reproducible? Based on the code and my testing, this happens when you drag some "non-file" draggable object onto the note. Could this be the case here?

sigaloid commented 2 years ago

It's reproducible in Sway WM (Wayland). However I couldn't record the problem with Wayland (OBS issue) so I switched back to i3 temporarily (X11) to record the issue. There, the issue didn't occur. I can only assume it's a Wayland bug with Chromium somehow.

darkpoetry commented 1 year ago

I am also getting this on 0.57.5 with PDF documents, mp3 files. It's hard to predict when it will work successfully. Choosing "import into note" from right click context works as a backup. I am also using Gnome on Wayland. I'm using the NVIDIA proprietary drivers (Arch Linux) v. 525.78.01. The relevant errors are:

JS Error: Cannot parse JSON '' into notes for drop Stack: Error at C (http://127.0.0.1:37840/assets/v0.57.5/app-dist/desktop.js:2:96330) at Object.dragDrop (http://127.0.0.1:37840/assets/v0.57.5/app-dist/desktop.js:2:161891) at P.L (http://127.0.0.1:37840/assets/v0.57.5/libraries/fancytree/jquery.fancytree-all-deps.min.js:1:91573) at HTMLUListElement.dispatch (http://127.0.0.1:37840/assets/v0.57.5/libraries/jquery.min.js:2:43064) at HTMLUListElement.v.handle (http://127.0.0.1:37840/assets/v0.57.5/libraries/jquery.min.js:2:41048)

darkpoetry commented 1 year ago

I'd also like to add that a similar non-response happens during drag and drop rearrangement of the document tree. Pretty much any mouse-driven action is foiled by this bug; somewhat randomly.

Unfortunately the only video driver that works properly on all of my stuff is nvidia + wayland, and that is the general direction that window managers are headed in.

Please let me know if I can do any kind of special logging to sort this out.

darkpoetry commented 1 year ago

One additional insight on this- if the drag+drop happens in the same monitor, it tends to work. Only if dragging from one monitor onto another monitor does it fail in recent testing. The target note also needs to be click-highlighted before it will accept the dragged files, which is counterintuitive.