Joplin: Desktop: Deleting Notebook Slower Than Selecting All Notes and Hitting Delete

Created on 9 Mar 2020  路  11Comments  路  Source: laurent22/joplin

Environment

Joplin version: all versions past v1.0.179 (don't know about previous versions)
Platform: Linux
OS specifics: Artix Linux 64 bit

Steps to reproduce

  1. Create a new notebook (any name will do)
  2. Create 4 different notes
  3. Duplicate these notes as many times as you can (i did over 1000 in my test)
  4. Select 1st note
  5. Hold Shift and select last note
  6. Hit Delete key or Click Delete on Right
  7. Click Yes
  8. Repeat Steps 1-3
  9. Select Notebook
  10. Repeat Step 6

Describe what you expected to happen

Both should delete notes at the same speed but Notebook delete is drastically slower.

Logfile


Not home but can produce a log when i arrive.

bug good first issue

Most helpful comment

Indeed I see that for "select all" it's calling batchDelete which deletes everything in one SQL command, while when deleting folders it's deleting notes one by one (and every time the UI has to update). I guess that should be an easy fix so I'm marking it as "good first issue".

All 11 comments

Indeed I see that for "select all" it's calling batchDelete which deletes everything in one SQL command, while when deleting folders it's deleting notes one by one (and every time the UI has to update). I guess that should be an easy fix so I'm marking it as "good first issue".

@laurent22 @bedwardly-down I would like to work on this issue please assign it to me.
Thank you.

I am working on fixing this issue. ASAP.

Indeed I see that for "select all" it's calling batchDelete which deletes everything in one SQL command, while when deleting folders it's deleting notes one by one (and every time the UI has to update). I guess that should be an easy fix so I'm marking it as "good first issue".

As you have said. I have found the code responsible for deleting folders and indeed it's deleting notes one by one instead of calling batch delete. I would like to fix this error.

Indeed I see that for "select all" it's calling batchDelete which deletes everything in one SQL command, while when deleting folders it's deleting notes one by one (and every time the UI has to update). I guess that should be an easy fix so I'm marking it as "good first issue".

As you have said. I have found the code responsible for deleting folders and indeed it's deleting notes one by one instead of calling batch delete. I would like to fix this error.

I was making changes to the file but when after saving i started the app using "npm start" the changes got reverted. What to do about that?

@Rahul-Shaikh what specific file are you changing? There are certain files that are deleted and recreated during the build process and you may be working with one of those.

@Rahul-Shaikh what specific file are you changing? There are certain files that are deleted and recreated during the build process and you may be working with one of those.

I was changing the Folder.js file. In that file in the delete function the noteIds are taken and being deleted by the use of a for loop. Changing that to a batchDelete function with the Ids will probably fix the problem i suppose.

I'm assuming ElectronClient/lib/models/Folder.js, right? I'm asking because that folder doesn't exist until the build script is ran. It's a copy of ReactNativeClient/lib/models and is deleted upon rebuilds. Making any changes there affects Mobile and Desktop.

@laurent22, @bedwardly-down I think this should fix this issue

I'm assuming ElectronClient/lib/models/Folder.js, right? I'm asking because that folder doesn't exist until the build script is ran. It's a copy of ReactNativeClient/lib/models and is deleted upon rebuilds. Making any changes there affects Mobile and Desktop.

yes that is the file. Understood so changes had to be done there.

@laurent22, @bedwardly-down I think this should fix this issue

This is the exact thing i had done in the ElectronClient but due to build always reverting. Not issuing a PR then

Was this page helpful?
0 / 5 - 0 ratings