BoostNote-App icon indicating copy to clipboard operation
BoostNote-App copied to clipboard

Dragging a folder onto a node leads to "Something wrong happened"

Open i-am-the-slime opened this issue 4 years ago • 6 comments

Issuehunt badges

Current behaviour

Error when dragging a folder onto a note:

image

Expected behaviour

Either fail gracefully, saying that dragging folders is not supported, but ideally zip the folder and and attach it.

Steps to reproduce

  1. Drag a folder onto a note

Environment

Latest macOS version.


IssueHunt Summary

Backers (Total: $20.00)

Become a backer now!

Or submit a pull request to get the deposits!

Tips

i-am-the-slime avatar Aug 11 '21 08:08 i-am-the-slime

Hi, i-am-the-slime,

can you please add more screenshots on how this happens,

Is this for boost note local space application or boost note cloud spaces desktop application? Or is it for web application?

I cannot reproduce it in cloud desktop app nor local space desktop app.

In cloud I get 'Opps resource is already present', in local space desktop app I get no errors showing.

Can you also tell me in which view mode are you in? image

See the image for modes.

Komediruzecki avatar Aug 11 '21 11:08 Komediruzecki

@Komediruzecki I think he was trying to drag and drop a folder from File manager app(Finder of macOS)

Rokt33r avatar Aug 19 '21 06:08 Rokt33r

@i-am-the-slime Zipping from the app is quite overkill for the web app since zipping from the frontend side should be really slow and unstable. But we can definitely improve our error message.

For anyone who wants to try to tackle this issue:

We should fix the error handler In cloud/components/molecules/Editor/index.tsx

        try {
          const { file: fileInfo } = await uploadFile(team, file, doc)
          const url = buildTeamFileUrl(team, fileInfo.name)
          if (file.type.match(/image\/.*/)) {
            return { type: 'img', url, alt: file.name }
          } else {
            return { type: 'file', url, title: file.name }
          }
        } catch (err) {
          pushApiErrorMessage(err) // This handler only understands errors from HTTP requests.  So we should check the type of the error and handle it differently so we can show proper error messages.
          return null
        }

https://github.com/BoostIO/BoostNote.next/blob/master/src/cloud/components/molecules/Editor/index.tsx#L424-L435

Rokt33r avatar Aug 19 '21 06:08 Rokt33r

Yes this is dragging a folder from Finder to the Desktop app.

@Rokt33r This is on the Desktop app. I guess it's in Electron, but I don't think there should be a limitation on what processes you can call from within node. Also, there's this: https://github.com/bpajk/WasmZip . Finally, I haven't tested this but I can't imagine zipping without compressing in JS to be that slow.

i-am-the-slime avatar Aug 19 '21 07:08 i-am-the-slime

@i-am-the-slime We need some battle-tested modules which work perfectly on every OS and browser. I think it is too risky to introduce the zipping feature to our application.

Rokt33r avatar Aug 20 '21 06:08 Rokt33r

@boostio has funded $20.00 to this issue.


issuehunt-oss[bot] avatar Sep 14 '21 09:09 issuehunt-oss[bot]