jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Wrong User for fileDirectoryLatex

Open lcnittl opened this issue 2 years ago β€’ 4 comments

JabRef version

5.9 (latest release)

Operating system

Windows

Details on version and operating system

No response

Checked with the latest development build

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

Steps to reproduce the behaviour

JabRef locks onto the first user encounter in fileDirectoryLatex.

To reproduce:

  1. Create bib file

  2. on a HostA with a UserA set fileDirectoryLatex to C:\Path\A (via GUI Library > Library properties > LaTeX file directory)

    This will create the following comment:

    @Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}
    

and shows in the GUI as:

image

  1. Move/Copy the file to a HostB

  2. on HostB with a UserB set fileDirectoryLatex to C:\Path\B

    Instead of the anticipated comments:

    @Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}
    
    @Comment{jabref-meta: fileDirectoryLatex-UserB-HostB:C:\\Path\\B;}
    

    the file will now contains:

    @Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}
    
    @Comment{jabref-meta: fileDirectoryLatex-UserA-HostB:C:\\Path\\B;}
    

    (note the user on HostB is set to UserA)

    Yet, the GUI shows:

    image

  3. Features like relative paths of Aux File (for TexGroup) do not work.

Temporary "fix" in the bib file:

The user can be manually corrected in the bib file (with a text editor):

@Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}

@Comment{jabref-meta: fileDirectoryLatex-UserB-HostB:C:\\Path\\B;}

Now, the TexGroup relative paths for Aux File works.

Problems encountered with this "fix":

However, the GUI shows an empty LaTeX file directory (Library > Library properties):

image

When adding C:\Path\B on HostB back via GUI, the bib file contains:

@Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}

@Comment{jabref-meta: fileDirectoryLatex-UserA-HostB:C:\\Path\\B;}

@Comment{jabref-meta: fileDirectoryLatex-UserB-HostB:C:\\Path\\B;}

(note the additional entry for HostB, again with the wrong user UserA)

The GUI would now show the field filled:

image

Appendix

No response

lcnittl avatar Jun 08 '23 07:06 lcnittl

This refs https://github.com/koppor/jabref/issues/572, because there should be a proper hover.

@lcnittl Can you show me, what on HostB is shown in the preferences as default owner?

grafik

koppor avatar Jun 08 '23 13:06 koppor

After this is fixed, work should start at https://github.com/JabRef/jabref/issues/8344

koppor avatar Jun 08 '23 13:06 koppor

@koppor Nice hint -- indeed the default owner on HostB was set to UserA (i.e. the OS username on HostA).

Some more testing, always starting from:

@Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}

(where JabRef default owner = OS username = UserA)

Actions performed on HostB: (OS username = UserB)

  1. JabRef default owner = UserA

    @Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}
    
    @Comment{jabref-meta: fileDirectoryLatex-UserA-HostB:C:\\Path\\B;}
    
  2. JabRef default owner = UserB (= OS username )

    @Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}
    
    @Comment{jabref-meta: fileDirectoryLatex-UserB-HostB:C:\\Path\\B;}
    

    β†’ this matches the desired config

  3. JabRef default owner = UserOther

    @Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}
    
    @Comment{jabref-meta: fileDirectoryLatex-UserOther-HostB:C:\\Path\\B;}
    

So there seems to be a mix-up between OS username and JabRef default owner:

  1. JabRef stores the "default owner" when writing the bib file, but
  2. the OS username is expected when reading the file

lcnittl avatar Jun 08 '23 14:06 lcnittl

Probably related: The fileDirectory property is also affected by this, although it uses "JabRef default owner" for both storing and reading (and completely ignores OS user).

lcnittl avatar Jun 13 '23 06:06 lcnittl

@jetbrains-junie Fix the issue

Siedlerchr avatar Jul 16 '25 17:07 Siedlerchr

Hey, it’s Junie by JetBrains! I started processing your request πŸš€

jetbrains-junie[bot] avatar Jul 16 '25 17:07 jetbrains-junie[bot]

βœ… Generation Status

  • Code generation was successful

Message:

The issue with JabRef using the wrong user for fileDirectoryLatex when moving files was fixed by modifying MetaDataParser.java to check the current user-host against the extracted user-host. Changes to the MetaData class ensured accurate retrieval of LaTeX file directories. The fix was tested and confirmed to maintain existing functionality before submission.


πŸ“Œ Issues Detected During Processing

  • Some issues occurred that may have limited the context available during generation.
  • These did not prevent the operation, but fixing them could improve the results.

Message:

❌ I tried to build the project before getting started, but it didn’t work.

There might be issues with the environment or the code itself. Please check build log for more details.

More information:

jetbrains-junie[bot] avatar Jul 16 '25 18:07 jetbrains-junie[bot]

@lcnittl Please test out the latest development version (remember to make a backup of your bib file)

Siedlerchr avatar Aug 04 '25 20:08 Siedlerchr