Fixes the auto-update problem with TexGroups on Ubuntu Linux and makes the detection of file modifications more reliable#7412
Conversation
|
Thanks for your PR. Can you please explain what the problem is/was and why your fix works? It looks like you only have a relative file in your tex group and want to resolve this path relative to the latex folder, is this correct? |
|
If the problem is that it is a relative path, perhaps this would be another location where the code could be added? |
|
Basically, the path for the creates a Path object Later, the "file-monitor" detects the modified file no proper entry for this file is found in the keys of the map, thus no listener gets informed. If @k3KAW8Pnf7mkmdSMPHz27 You are right. In this case, when the library is simply opened from within JabRef, your mentioned code line is not executed, but if one would convert an existing group to a tex-group, this should be a problem as well. |
|
Changing to
and ignoring the other fixes, should fix both cases (I. simply opening the library and II. changing a group to a |
|
I am not up-to-date on how changing the group type works in practice, but it seems like a good solution to the relativized path issue. |
|
Thanks for the explanation! #7412 (comment) looks like the right approach to me. In addition, I would suggest to add a method |
|
Basically, I agree with @tobiasdiez, same regarding #7173 (comment). |
…a group to a TexGroup
… file creation events for existing files as well as file modifications
|
I have tested this fix for loading a library, for changing a group to a @k3KAW8Pnf7mkmdSMPHz27 Could you check for safety reasons, that your library on macOS is still getting updated with this version? |
The library is still getting updated 👍 😃 |
|
Would be nice if someone can test this under Windows as well, because Windows and Linux behave differently regarding file watching events/file system operations |
|
Just a general thing: Please try to shorten your PR titles and commit messages and keep them meaningful, so after months you still understand, what you did. See https://www.freecodecamp.org/news/writing-good-commit-messages-a-practical-guide/ |
k3KAW8Pnf7mkmdSMPHz27
left a comment
There was a problem hiding this comment.
I don't have a full Windows 10 setup, but the relative path works when manually editing the .aux file. There is an issue in that TexGroup.create doesn't throw an exception if the file doesn't exist but it is not related to this PR.
984a779
Fixes #7173 (comment) in #7173.
On Ubuntu Linux the auto-update functionality does not work with
TexGroups, when the associated.auxfile gets updated externally.This is a quick fix for this issue, which may still be improved. Only one of both files needs to be changed in order to fix it.