You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Copy DOI URL breaks links that contain a tracking parameter #17689
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
Set an entry’s DOI field to https://doi.org/10.1371/journal.pone.0000308?utm_source=newsletter.
Right-click the entry in the library table and choose Copy… → Copy DOI URL.
Paste the copied link into a browser and open it.
Expected: The link opens the article for DOI 10.1371/journal.pone.0000308.
Actual: JabRef copies https://doi.org/10.1371/journal.pone.0000308%3Futm_source=newsletter. The browser shows “DOI NOT FOUND”. When I remove the tracking parameter from the DOI field, JabRef copies the correct link.
Appendix
The DOI field contains ?utm_source=newsletter, but Copy DOI URL changes the ? to %3F.
Opening the copied link in Safari gives “DOI NOT FOUND.”
Thank you for your continued work in JabRef. At this point, you probably already know the basics and the important links. If not, our contributing guidelines is the place you should go to.
At this point in time, you raised 2 pull request(s) of which 0% (0/2) have been merged.
Hi @Siedlerchr, @koppor! I have forked the repository and analyzed the root cause in DOI.java:
Root Cause Analysis:
In DOI.java, the regex DOI_EXP uses (?:[^\s,]+[^,;(\.\s)]) for the DOI suffix. Because ? is not excluded, DOI_GROUP consumes trailing query parameters (like ?utm_source=newsletter) into this.doi.
When getExternalURIFromBase(URI base) constructs the URI using new URI(base.getScheme(), base.getHost(), "/" + doi, null), Java's 4-argument URI constructor treats the entire string as the path component and percent-encodes ? into %3F. This results in .../0000308%3Futm_source=newsletter, causing doi.org to return "DOI NOT FOUND".
Proposed Solution:
Following @Siedlerchr's feedback to strip tracking parameters:
Clean/strip query parameters from the DOI input string during parsing/extraction in DOI.java so that this.doi stores the clean canonical identifier (10.1371/journal.pone.0000308).
Ensure getExternalURI() and getURI() naturally produce the clean canonical resolver URL.
Add unit tests in DOITest.java with URLs containing query/tracking parameters (e.g. ?utm_source=...) to verify proper stripping and valid URI generation.
(Note: In PR #17706, the query parameters were kept and passed as a URI query component rather than stripped, which leaves tracking parameters attached to the canonical DOI).
I see @AnishKmSingh is currently assigned to this issue. If Anish needs any help or decides to pass, I have already forked the repository and investigated the fix, and would be glad to take it up!
Activity
Siedlerchr commentedon Nov 4, 2026
We should strip such tracking parameters
koppor commentedon Nov 4, 2026
Good issue to learn about regex, data modelling and utility classes.
AnishKmSingh commentedon Nov 4, 2026
/assign-me
jabref-machine commentedon Nov 4, 2026
Thank you for your continued work in JabRef. At this point, you probably already know the basics and the important links. If not, our contributing guidelines is the place you should go to.
At this point in time, you raised 2 pull request(s) of which 0% (0/2) have been merged.
github-actions commentedon Nov 4, 2026
@PavithraT-26826 opened #17706 for this issue without being assigned. @AnishKmSingh: this does not affect your assignment.
SachinyadavAug20 commentedon Nov 4, 2026
Hi @Siedlerchr, @koppor! I have forked the repository and analyzed the root cause in
DOI.java:Root Cause Analysis:
DOI.java, the regexDOI_EXPuses(?:[^\s,]+[^,;(\.\s)])for the DOI suffix. Because?is not excluded,DOI_GROUPconsumes trailing query parameters (like?utm_source=newsletter) intothis.doi.getExternalURIFromBase(URI base)constructs the URI usingnew URI(base.getScheme(), base.getHost(), "/" + doi, null), Java's 4-argumentURIconstructor treats the entire string as the path component and percent-encodes?into%3F. This results in.../0000308%3Futm_source=newsletter, causingdoi.orgto return "DOI NOT FOUND".Proposed Solution:
Following @Siedlerchr's feedback to strip tracking parameters:
DOI.javaso thatthis.doistores the clean canonical identifier (10.1371/journal.pone.0000308).getExternalURI()andgetURI()naturally produce the clean canonical resolver URL.DOITest.javawith URLs containing query/tracking parameters (e.g.?utm_source=...) to verify proper stripping and valid URI generation.(Note: In PR #17706, the query parameters were kept and passed as a URI query component rather than stripped, which leaves tracking parameters attached to the canonical DOI).
I see @AnishKmSingh is currently assigned to this issue. If Anish needs any help or decides to pass, I have already forked the repository and investigated the fix, and would be glad to take it up!
Abhishek-Padmanabhakumar commentedon Nov 4, 2026
/assign-me
jabref-machine commentedon Nov 4, 2026
Hi @Abhishek-Padmanabhakumar, this issue is currently assigned to @AnishKmSingh.
Note
If no progress is made within 8 days, the issue will be automatically unassigned.
Options for contributors
github-actions commentedon Nov 4, 2026
@Abhishek-Padmanabhakumar opened #17709 for this issue without being assigned. @AnishKmSingh: this does not affect your assignment.
Siedlerchr commentedon Nov 4, 2026
We have plenty of others issues.
github-actions commentedon Nov 9, 2026
We think that this issue was fixed. Please head to https://builds.jabref.org/main to download a development build and try it out.
For any feedback, add a comment to the pull request at #17713.
Remove query and fragment from doi.org links when parsing DOIs (JabRe…