JabRef / jabref

Graphical Java application for managing BibTeX and biblatex (.bib) databases
https://devdocs.jabref.org
MIT License
3.6k stars 2.57k forks source link

Issues with adding/deleting linked files #9731

Open AEgit opened 1 year ago

AEgit commented 1 year ago

JabRef version

Latest development branch build (please note build date below)

Operating system

Windows

Details on version and operating system

Windows 10

Checked with the latest development build

Steps to reproduce the behaviour

JabRef 5.10--2023-04-02--1896c99 Windows 10 10.0 amd64 Java 19.0.2 JavaFX 20+19

I observed two issues when adding and removing linked files. The first issue appears when a linked file is deleted on the level of the operating system (e.g., Windows Explorer) while JabRef is running. The respective file is not automatically removed from the linked files within JabRef. This behaviour is (probably?) fine, I guess, since otherwise JabRef would have to constantly monitor for such changes which would have a significant performance impact when dealing with large databases. But when you try to remove the respective linked file using Delin the main table view of the article, you get the message: Error accessing file nameofyourfile (where nameofyourfile represents the name of the file you had deleted earlier in your file manager). The only way to remove this linked file is to right-click on the file and then press Remove link. If multiple files have been removed with the file explorer, then you have to repeat this workaround for every single file individually (you cannot use the function Remove link for multiple files apparently).

  1. Open JabRef with a database containing linked files
  2. Open your file manager, e.g. Windows Explorer and delete some of the linked files
  3. The deleted linked files are still visible in the main table view of the respective articles
  4. Using Del to deleted such a deleted file in the main table view results in the error message: Error accessing file nameofyourfile
  5. You can delete the link to the respective file in JabRef by right-clicking onto the file and then using the function Remove link.
  6. But if you are dealing with multiple files, you have to repeat this step for each file individually, i. e. you cannot apply the function Remove link to multiple files simultaneously.
  7. The user would expect that Del should be enough to remove deleted files, that are still linked with their JabRef database

The second issue presents itself in larger databases (several 1000s of static groups, 10s of 1000s of items and a similar amount of linked files):

  1. Open JabRef with a database containing linked files
  2. Press Del to remove some linked files and confirm with Remove from entry
  3. Note, how JabRef freezes for roughly 5-10 sec - the task manager indicates a CPU spike when performing this action
  4. Now link a few files using JabRef with the + button
  5. JabRef will freeze again for a couple of sec and the task manager indicates a spiking CPU again

So basically the simple action of adding and removing linked files results in major CPU load. I suspect this might be related to the auto-link feature of JabRef, but that is just speculation from my side. Note, that indexing of linked files for `Fulltext search' has been turned off, so that option cannot explain the performance problems. Also note, that the performance issue is less apparent when using small databases - you still see a small increase in CPU load, but it is far from that seen with large JabRef databases.

jorgman1 commented 1 year ago

I have a related concern: The behaviour for deleting linked urls (e.g. PubMed entries included by the JabRef browser extension) in the file field got more difficult. Before it was possible to simply press the DEL-key, but now it is only possible by using a right click and then pressing "Remove link". Pressing DEL triggers a warning that the file could not be accessed.

bilderbuchi commented 1 year ago

Another related thing that surprised me (as a new user): Deleting an entry does not delete the linked file! I suspect this will just result in more and more stale files (pdfs which don't have an associated entry) in the folder with the linked files. At the same time, I did not find a way to scan that folder for such files, so cleaning this up manually seems unfeasible with 100s-1000s of entries?

bilderbuchi commented 1 year ago

At the same time, I did not find a way to scan that folder for such files, so cleaning this up manually seems unfeasible with 100s-1000s of entries?

Ha, scratch that, I just found Lookup - Search for unlinked local files, so at least the issue of files not being deleted can be mitigated manually.

koppor commented 3 weeks ago

Similar issue if the file link is a URL. (For instance added when one does not have access to the file. Add https://doi.org/10.1007/978-3-031-36847-9_2, then use the file search functionalilty. --> html is downloaded --> cannot be deleted using Del, but with right click)