Skip to content

Copy DOI URL breaks links that contain a tracking parameter #17689

Closed

Description

@doraem-on

JabRef version

5.15 (latest release)

Operating system

macOS

Details on version and operating system

JabRef 5.15 on macOS 26.5.2 (Apple silicon)

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. Set an entry’s DOI field to https://doi.org/10.1371/journal.pone.0000308?utm_source=newsletter.
  2. Right-click the entry in the library table and choose Copy… → Copy DOI URL.
  3. 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.

Image

Opening the copied link in Safari gives “DOI NOT FOUND.”
Image

...

Log File
Paste an excerpt of your log file here

Activity

  1. added
    status: needs-triage
    on Nov 4, 2026
  2. added theissue type on Nov 4, 2026
  3. Siedlerchr commented on Nov 4, 2026

    @Siedlerchr
    Member

    We should strip such tracking parameters

  4. removed
    status: needs-triage
    on Nov 4, 2026
  5. added
    good first issue
    on Nov 4, 2026
  6. koppor commented on Nov 4, 2026

    @koppor
    Member

    Good issue to learn about regex, data modelling and utility classes.

  7. AnishKmSingh commented on Nov 4, 2026

    @AnishKmSingh
    Contributor

    /assign-me

  8. added
    📍 Assigned
    on Nov 4, 2026
  9. jabref-machine commented on Nov 4, 2026

    @jabref-machine
    Collaborator

    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.

  10. moved this from Free to take to Assigned in Good First Issueson Nov 4, 2026
  11. moved this from Assigned to In Progress in Good First Issueson Nov 4, 2026
  12. github-actions commented on Nov 4, 2026

    @github-actions
    Contributor

    @PavithraT-26826 opened #17706 for this issue without being assigned. @AnishKmSingh: this does not affect your assignment.

  13. SachinyadavAug20 commented on Nov 4, 2026

    @SachinyadavAug20
    Contributor

    Hi @Siedlerchr, @koppor! I have forked the repository and analyzed the root cause in DOI.java:

    Root Cause Analysis:

    1. 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.
    2. 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!

  14. Abhishek-Padmanabhakumar commented on Nov 4, 2026

    @Abhishek-Padmanabhakumar

    /assign-me

  15. jabref-machine commented on Nov 4, 2026

    @jabref-machine
    Collaborator

    ⚠️ Issue Already Assigned

    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
    • Wait for availability: The issue may become available if auto-unassigned
    • Collaborate: You can ask the assignee if they want help
    • Maintainer assistance: A maintainer can add you as co-assignee if appropriate
  16. github-actions commented on Nov 4, 2026

    @github-actions
    Contributor

    @Abhishek-Padmanabhakumar opened #17709 for this issue without being assigned. @AnishKmSingh: this does not affect your assignment.

  17. Siedlerchr commented on Nov 4, 2026

    @Siedlerchr
    Member

    We have plenty of others issues.

  18. moved this from In Progress to Done in Good First Issueson Nov 9, 2026
  19. moved this from Normal priority to Done in Prioritizationon Nov 9, 2026
  20. github-actions commented on Nov 9, 2026

    @github-actions
    Contributor

    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.

  21. added a commit that references this issue on Nov 9, 2026
    be8eb38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issue📌 Pinned📍 Assigned

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions