Empty Trash Bin versus select items in the trash and Delete Permanently

edited June 21, 2024
If I empty the trash by right-click empty even with about 50 items it takes a long time to be able to click on another collection and view its contents. If I select items from the Trash/Bin and select (even 200) items I can immediately view the contents of another collection after I right-click Delete Permanently. On another thread I learned that eliminating a lower quantity of items at a time and letting the system go a long time -- even overnight -- was the best way to handle the trash delay.

Is Delete Permanently going to create a problem if I will never need the items again? If I delete a collection and items locally and the collection and items are on the Zotero website what will happen when I sync? If it is normal for the items to sync back to my local how do I block that download?

I tried to get help by searching the documentation for "trash" but 1) DDG provided me with several advertisements above the Zotero site results; and 2) the Zotero items that were returned shed little or no light on my questions about the functionality of the trash and any difference between methods of eliminating items from the trash (bin). Zotero documentation keeps getting better and better but the ability to find information that I want isn't great. I know that it is rather against policy to accept a bounty-based feature request for the software itself. I might be able to corral a few colleagues in the indexing world to develop a robust system that would reside on a Zotero server. (This is the sort of "fun" pro-bono challenge that might be welcomed.) If interested, you folks have my direct email address.
  • edited June 21, 2024
    It's just a question of when the delay happens. Zotero has to do some cleanup in the database after items are deleted. Empty Trash triggers it immediately. If you use Delete Permanently, it will happen on the next sync or restart.

    And yes, if you're regularly cycling through tens (hundreds?) of thousands of items, that's just kind of out of scope of what Zotero is designed and tested for. Doesn't mean you can't do it, or that we can't improve it, but you might run into problems.

    When you're potentially able to leave Zotero alone for a while, you can trigger the cleanup manually from Tools → Developer → Run JavaScript just to see how long it takes:

    var t = new Date();
    Zotero.Prefs.set('purge.creators', true)
    Zotero.Prefs.set('purge.tags', true)
    Zotero.Prefs.set('purge.fulltext', true)
    Zotero.Prefs.set('purge.items', true)
    await Zotero.purgeDataObjects();
    return (new Date() - t) + " ms";


    For me, in a test database with ~10K top-level items, this takes <100 ms (i.e., a 1/10 of a second).
  • Thank you. I'll try that and test. I'll report the results.

    Will this kill everything or only items in the trash? I presume only items in the trash.

    If everything, the things I want to keep will be returned upon a sync; correct?
  • It's just the internal database cleanup. This is just to test how long it takes.
  • This is not a complaint!

    After running the JavaScript, I had great success with almost immediately gaining access to the contents of collections after running the script. However, when I updated to beta 91 the collection contents are taking a long time to load. Currently at one hour and counting. That said, I am content.

    I do very much thank you for helping with what is a problem unique to my unusual use of Zotero. I have extraordinary respect not only for your programming and management chops but also for the patience you display with my odd requests and when less than polite forum users say outrageous things.
  • But the question is how long the above code took to run — when it finishes, it will show a timing in the right-hand pane.
  • TimeoutError: operation timed out.
  • The collection contents became visible and accessible about 3.5 hours after I restarted with beta 91. If that helps....
  • edited June 22, 2024
    When I tried to import an nbib file upon clicking on the continue button I get the Introduction Mendeley import request for username and password. I quit Zotero and restarted with logging enabled but received an Apple error that Zotero quit unexpectedly. The Apple error text was sent to support@zotero.org.

    I was able to restart and tried again to import. I don't know if logging began upon the manual restart. The debug ID is: D1145992550.

    Edit: I restarted Zotero. I enabled debug logging and tried to import the file→import and when I clicked Continue I received the Mendeley login box again. I hope that this captured the problem.

    D1931454789.
  • You're saying the "A file" radio button is selected but it's taking you to the Mendeley import pane?
  • Yes, the "A File" radio button is selected. Very puzzling. I reported this about a year ago in a different context.

    https://forums.zotero.org/discussion/105705/beta-7-cannot-import-nbib-received-mendeley-error-screen/p1

    Did my debug today fail to capture this problem?
  • edited June 23, 2024
    I just tried to make a video of the problem but the file too enormous for email. I kind-of fumbled when making the video and it was longer than optimum. I tried again and the import worked. I promise that I had the "A File" button selected and instead of being able to select a file I received the Mendeley import pane. Could this be happening only when Zotero is very busy?

    Edit: it just occurred to me that I could post it to my Dropbox. I don't know how to recover deleted videos from my iphone.
  • OK, it looks like this would happen if there's a long-running operation that prevents the import dialog from doing its initialization right away. It then shows the Mendeley import pane instead of the usual options pane.

    We'll fix that, but this is just more of what I say above — cycling through huge numbers of items is just causing all sorts of problems for you. We'll try to optimize the cleanup process Zotero needs to do after large number of items are purged from the trash so that it stops causing problems for you, but you're unfortunately just well outside of normal usage patterns.
  • Thank you, so much appreciated!
  • Actually, give beta 93 a try. The speed of the cleanup process after emptying the trash might be drastically improved.
  • I have used 93 and am now on 98, having used the others in between. I quit and restart Zotero daily. I can access the contents of my collections almost instantly but the number of items in my trash doesn't decline when I empty it. In fact, the number increases each time I move 10-15 items to the trash bin. (The count doesn't decline).

    I delayed responding because I wanted to see how quitting and reopening might affect the trash-bin. If I click on some individual records I have the option to restore or delete permanently but on others a click does not offer any option. If I select numerous items but (not the items where I'm not offered the restore / delete option) I am given the restore / delete permanently option. If the selection includes one of the non-option records I am not offered the option.

    Do you require more information? I'm content but wonder about how many records I can allow the trash-bin to accumulate (currently 14,415 items).
  • When using 99 if I select all and permanently delete, then quit Zotero after the delete process seems to finish; upon re-opening Zotero there is a several second delay but I have access to collection contents and no records are listed in the trash. I consider this a success!
Sign In or Register to comment.