Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with adding/deleting linked files #9731

Closed
2 tasks done
AEgit opened this issue Apr 3, 2023 · 4 comments · Fixed by #12324
Closed
2 tasks done

Issues with adding/deleting linked files #9731

AEgit opened this issue Apr 3, 2023 · 4 comments · Fixed by #12324
Labels
bug Confirmed bugs or reports that are very likely to be bugs external files type: performance
Milestone

Comments

@AEgit
Copy link

AEgit commented Apr 3, 2023

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

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

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.

@github-project-automation github-project-automation bot moved this to Normal priority in Prioritization Apr 3, 2023
@ThiloteE ThiloteE added the bug Confirmed bugs or reports that are very likely to be bugs label Apr 3, 2023
@ThiloteE ThiloteE moved this from Normal priority to High priority in Prioritization Apr 3, 2023
@jorgman1
Copy link

jorgman1 commented Jun 2, 2023

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.

@koppor koppor added this to the v6.0 milestone Jun 3, 2023
@bilderbuchi
Copy link

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
Copy link

bilderbuchi commented Jun 26, 2023

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
Copy link
Member

koppor commented Sep 25, 2024

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)

github-merge-queue bot pushed a commit that referenced this issue Dec 23, 2024
#12324)

* Just Delete link from entry if the file is no longer accesible on disk

Fixes #9731

* Update CHANGELOG.md

Co-authored-by: Subhramit Basu Bhowmick <[email protected]>

---------

Co-authored-by: Subhramit Basu Bhowmick <[email protected]>
@github-project-automation github-project-automation bot moved this from High priority to Done in Prioritization Dec 23, 2024
ar-rana pushed a commit to ar-rana/jabref that referenced this issue Dec 26, 2024
JabRef#12324)

* Just Delete link from entry if the file is no longer accesible on disk

Fixes JabRef#9731

* Update CHANGELOG.md

Co-authored-by: Subhramit Basu Bhowmick <[email protected]>

---------

Co-authored-by: Subhramit Basu Bhowmick <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs external files type: performance
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants