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

Importing an entry with the browser extension doesn't delete temporary files #11048

Open
2 tasks done
ror3d opened this issue Mar 19, 2024 · 8 comments
Open
2 tasks done
Assignees
Labels
FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty.

Comments

@ror3d
Copy link
Contributor

ror3d commented Mar 19, 2024

JabRef version

5.12 (latest release)

Operating system

Windows

Details on version and operating system

Windows 11

Checked with the latest development build (copy version output from About dialog)

  • 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

  1. Edit the JabRefHost.ps1 file in your JabRef installation
  2. Change line 40 (Remove-Item...) with the following:
     $rout = Remove-Item $tempfile *>&1
     $wshell = New-Object -ComObject Wscript.Shell
     $wshell.Popup("ROut: $rout", 0, "JabRef", 0x0 + 0x30)
    
  3. Open JabRef
  4. Use the JabRef browser extension in any article to try to import it
  5. Upon import, a popup window will open showing the output of the Remove-Item command, reporting that it cannot remove the temporary file because it is being used:
    image

This is probably due to the JabRef command being called unblocking. The script has to exit to send back the result to the browser, but the open JabRef instance might still have the file open, so the script can't delete it before exiting.

Being able to send the file as stdin, or as a command-line argument, instead of creating a temporary file, could be a solution for this issue. Another approach could be connection using sockets in some way.

Appendix

No response

@ror3d
Copy link
Contributor Author

ror3d commented Mar 19, 2024

This is related to JabRef/JabRef-Browser-Extension#493 but that one is about the issue of the extension reporting an error, which should be solved with PR #11047, whereas this issue is about the still unresolved problem left in that PR.

@tobiasdiez
Copy link
Member

tobiasdiez commented Mar 19, 2024

Being able to send the file as stdin, or as a command-line argument, instead of creating a temporary file, could be a solution for this issue.

This is what we had before. But some of the bibtex can be quite long and then you hit the maximum length of the command line argument.

Is it really important to you to delete the temporary file? Windows 10+ normally clean the temp folder automatically, so it shouldn't really be a problem that there are still files lying around. I honestly don't see a clean way to clean them up, since as you say we need to return as fast as possible from the script.

It would perhaps work to pass a --deleteWhenClosing cmd line arg to jabref's main exe, and then clean up the file when the main jabref program is closed - but that feels a bit overkill.

@ror3d
Copy link
Contributor Author

ror3d commented Mar 19, 2024

Right, as command-line argument would have such problem, sending them through stdin should work well though.

On the other hand, I am also thinking of ways that JabRef/JabRef-Browser-Extension#481 could use a similar approach, but that might be a bit more tricky.

As for temp files being automatically deleted, if that is the case then this is not really a problem I guess.

@Siedlerchr Siedlerchr added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Mar 24, 2024
@Deehuh
Copy link

Deehuh commented Sep 27, 2024

Hi, I'm working with a group of 2 other CS students from Florida International University. We are part of the Tech Talent Academy program where we are required to join an open source project and make a contribution. We were wondering if we could tackle this issue

@ThiloteE
Copy link
Member

@Deehuh since you and your teammates already have been assigned to another issue, I will not assign you to this one to avoid confusion. I expect you will only work on one issue anway, right?

@Deehuh
Copy link

Deehuh commented Sep 27, 2024

Yes, that's correct. Thank you.

@Noah-Martin1
Copy link

Hello, has anyone been assigned this issue yet? I am from ANU in australia and would like to work on this issue with my group for an assignment.

@Siedlerchr Siedlerchr added the FirstTimeCodeContribution Triggers GitHub Greeter Workflow label Oct 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

Welcome to the vibrant world of open-source development with JabRef!

Newcomers, we're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly.

In case you encounter failing tests during development, please check our developer FAQs!

Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback.

Happy coding! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FirstTimeCodeContribution Triggers GitHub Greeter Workflow good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
Status: Normal priority
Status: Assigned
Development

No branches or pull requests

6 participants