BoostIO / BoostNote-Legacy

This repository is outdated and new Boost Note app is available! We've launched a new Boost Note app which supports real-time collaborative writing. https://github.com/BoostIO/BoostNote-App
Other
17.07k stars 1.47k forks source link

Folders cannot be removed on ArchLinux #3520

Open justdanyul opened 4 years ago

justdanyul commented 4 years ago

Current behavior

When I ask boost note to delete a folder, nothing happends and the folder remains. See animation below

peek_boostnote

Expected behavior

The folder is deleted

Steps to reproduce

  1. Create a folder
  2. Attempt to delete the folder
  3. Watch the folder gloat in your futile attempt to get rid of it

Environment

Flexo013 commented 4 years ago

I imagine this is related to other ArchLinux bugs #3372

Bug does not occurs on Ubuntu 16.04 or Windows 10.

jerome-diver commented 4 years ago

It should be useful to see how boostnote source code does to delete a folder to understand why on the most KISS Linux system it failed to run. Maybe it can be the way to fix this boostnote bug ? Please boostnote devs team, let me know which lines of which files is this happening, i can maybe help to fix that.

ZeroX-DG commented 4 years ago

@jerome-diver The code behind this delete folder feature is here: https://github.com/BoostIO/Boostnote/blob/961644747e9ee9c465a2a603552abe08c689c956/browser/main/SideNav/StorageItem.js#L234-L254

It seem to be not handling any error so when an error occur, it just ignore it and does nothing. It would be great if you can help us investigate on this

jerome-diver commented 4 years ago

I'm trying to understand something around:

data => { 
       dispatch({ 
         type: 'DELETE_FOLDER', 
         storage: data.storage, 
         folderKey: data.folderKey 
       }) 
     }

should look at the dataApi implementation. why storage key is data.storage and folderKey is data.folderKey ? looks like data is from dataApi.deleteFolder(storage.key, folder.key). So just remove data doesn't need any storage and folderKey keys ? why does it need it ? There is something strange there. Maybe include a console.log in there should show any debug values or any object state...

ZeroX-DG commented 4 years ago

@jerome-diver The code that responsible for deleting folder is located here: https://github.com/BoostIO/Boostnote/blob/master/browser/main/lib/dataApi/deleteFolder.js

If you check out the last part of the code, you can see that it perform an update to the boostnote.json file which contains information about what storages and folders that the user has. That's why it require a storage & a folder key. After it deleted the folder, it returns the storage along with the folder key to dispatch an event DELETE_FOLDER to update the application state & update the UI.

One way to start investigating this problem is to attach a catch after it delete the folder to see if there's any error emitted when the delete process happens.