Skip to content

Remove the duplicated validation status listener from SourceTab.#14815

Merged
Siedlerchr merged 5 commits into
JabRef:mainfrom
Siva-Sai22:fix/#14805
Jan 6, 2026
Merged

Remove the duplicated validation status listener from SourceTab.#14815
Siedlerchr merged 5 commits into
JabRef:mainfrom
Siva-Sai22:fix/#14805

Conversation

@Siva-Sai22

@Siva-Sai22 Siva-Sai22 commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

User description

Closes #14805

Removed a redundant validation listener in the SourceTab class that was triggering duplicate error dialogs when invalid BibTeX source was detected, as the storeSource method already handles parsing errors and user notifications adequately. This eliminates the loop of modal dialogs blocking the entry editor without fixing the source.

Steps to test

  1. Launch JabRef and create a new library with an entry.
  2. Open the entry editor, switch to the Source tab, and make the BibLaTeX invalid (e.g., delete the final closing brace }).
  3. Switch to another tab or click anywhere else to remove focus from the BibLaTeX tab to trigger error handling.
  4. Click OK on the error dialog.
  5. Verify that only one error dialog appears and the editor remains usable without immediate re-triggering of another dialog.
Screencast_20260106_205305.webm

Mandatory checks


PR Type

Bug fix


Description

  • Removed redundant validation listener causing duplicate error dialogs

  • Validation errors now handled solely by storeSource method

  • Eliminates modal dialog loop blocking entry editor


Diagram Walkthrough

flowchart LR
  A["SourceTab validation listener"] -->|removed| B["Single error handling"]
  C["storeSource method"] -->|already handles| B
  B -->|result| D["No duplicate dialogs"]
Loading

File Walkthrough

Relevant files
Bug fix
SourceTab.java
Remove redundant validation listener from SourceTab           

jabgui/src/main/java/org/jabref/gui/entryeditor/SourceTab.java

  • Removed unused import ValidationStatus
  • Deleted redundant validation listener that triggered duplicate error
    dialogs
  • Listener was monitoring
    sourceValidator.getValidationStatus().getMessages() and showing
    warning dialogs
  • Functionality already provided by storeSource method which handles
    parsing errors
+0/-13   
Documentation
CHANGELOG.md
Document duplicate error dialog fix                                           

CHANGELOG.md

+1/-0     

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #13109
🔴 Make the Pseudonymization class available on the CLI
Implement similar CLI experience to the consistency check
Follow the implementation pattern of the CheckConsistency class
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jan 6, 2026

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Learned
best practice
Place bug fixes in Fixed section

Move the changelog entry to the "Fixed" section instead of "Added" section, as
this describes a bug fix rather than a new feature.

CHANGELOG.md [12-14]

-### Added
+### Fixed
 
 - We fixed an issue where a redundant validation listener was causing duplicate error dialogs when invalid BibTeX source was detected in the SourceTab. [#14805](https://github.com/JabRef/jabref/issues/14805)
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why:
Relevant best practice - Changelog entries should be placed in the appropriate section. Bug fixes should be documented under "Fixed" section, not "Added" section.

Low
  • Update

@github-actions github-actions Bot added the status: changes-required Pull requests that are not yet complete label Jan 6, 2026
@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jan 6, 2026
@github-actions github-actions Bot removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jan 6, 2026
@github-actions github-actions Bot removed the status: changes-required Pull requests that are not yet complete label Jan 6, 2026

@subhramit subhramit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, one of us needs to check why unrelated tests are failing

@Siva-Sai22

Copy link
Copy Markdown
Contributor Author

@subhramit
these tests were passing a commit ago. A test got failed because I have not removed unused localization
I fixed that and now these were failing.
I pushed a empty commit to check if its tests issue or any issue in the ci/cd

@subhramit

subhramit commented Jan 6, 2026

Copy link
Copy Markdown
Member

@subhramit these tests were passing a commit ago. A test got failed because I have not removed unused localization I fixed that and now these were failing. I pushed a empty commit to check if its tests issue or any issue in the ci/cd

org.jabref.gui.fieldeditors.LinkedFileViewModelTest

  downloadPdfFileWhenLinkedFilePointsToPdfUrl(boolean)

    Test [1] true FAILED

    org.opentest4j.AssertionFailedError
        at app/org.jabref/org.jabref.gui.fieldeditors.LinkedFileViewModelTest.downloadPdfFileWhenLinkedFilePointsToPdfUrl(LinkedFileViewModelTest.java:298)

    Test [2] false FAILED

    org.opentest4j.AssertionFailedError
        at app/org.jabref/org.jabref.gui.fieldeditors.LinkedFileViewModelTest.downloadPdfFileWhenLinkedFilePointsToPdfUrl(LinkedFileViewModelTest.java:298)


2026-01-06 15:42:26 [Test worker] org.gradle.api.internal.tasks.testing.worker.TestWorker.execute()
INFO: Gradle Test Executor 12 finished executing tests.
2026-01-06 15:42:27 [Test worker] org.gradle.api.internal.tasks.testing.worker.TestWorker.execute()
INFO: Gradle Test Executor 13 started executing tests.

(java:3895): dbind-WARNING **: 15:42:28.820: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

> Task :jabgui:test

org.jabref.gui.linkedfile.DownloadLinkedFileActionTest

  Test replacesLinkedFiles(Path) FAILED

  org.opentest4j.AssertionFailedError: expected: <[ParsedFileField{description='', link='/tmp/junit-12374738821660726715/asdf.pdf', fileType='PDF', sourceUrl='http://arxiv.org/pdf/1207.0408v1'}]> but was: <[]>
      at app/org.jabref/org.jabref.gui.linkedfile.DownloadLinkedFileActionTest.replacesLinkedFiles(DownloadLinkedFileActionTest.java:96)


  doesntReplaceSourceURL(boolean)

    Test [1] true FAILED

    org.opentest4j.AssertionFailedError: expected: <[ParsedFileField{description='', link='/tmp/junit-6350193331887083893/asdf.pdf', fileType='PDF', sourceUrl='http://arxiv.org/pdf/1207.0408v1'}]> but was: <[]>
        at app/org.jabref/org.jabref.gui.linkedfile.DownloadLinkedFileActionTest.doesntReplaceSourceURL(DownloadLinkedFileActionTest.java:121)

    Test [2] false FAILED

    org.opentest4j.AssertionFailedError: expected: <[ParsedFileField{description='', link='/tmp/junit-16191715732590128158/asdf.pdf', fileType='PDF', sourceUrl='http://arxiv.org/pdf/1207.0408v1'}]> but was: <[]>
        at app/org.jabref/org.jabref.gui.linkedfile.DownloadLinkedFileActionTest.doesntReplaceSourceURL(DownloadLinkedFileActionTest.java:121)

they don't seem to be related to localization, or your PR.

@Siva-Sai22

Copy link
Copy Markdown
Contributor Author

@subhramit
see they passed
I think these are due to inconsistent github ci/cd

@Siva-Sai22

Copy link
Copy Markdown
Contributor Author

Actually I was saying that they passed a while ago but jablib tests failed due to localization issue
I fixed them using this commit e685cd5
But after that they were failing now I pushed an empty commit and they passed. I cant understand why they failed

@subhramit

Copy link
Copy Markdown
Member

Actually I was saying that they passed a while ago but jablib tests failed due to localization issue I fixed them using this commit e685cd5 But after that they were failing now I pushed an empty commit and they passed. I cant understand why they failed

got it

@subhramit

Copy link
Copy Markdown
Member

please adapt the PR title, it is not informative. Check other PRs

@subhramit subhramit added the status: awaiting-second-review For non-trivial changes label Jan 6, 2026
@Siva-Sai22 Siva-Sai22 changed the title Fix/#14805 Remove the duplicated validation status listener from SourceTab. Jan 6, 2026
@Siedlerchr

Copy link
Copy Markdown
Member

Tested it; it, works. SourceTab is not focused again, but that can be done in a follow up task.

@Siedlerchr Siedlerchr added this pull request to the merge queue Jan 6, 2026
Merged via the queue into JabRef:main with commit 96882e4 Jan 6, 2026
67 of 71 checks passed
@Siva-Sai22 Siva-Sai22 deleted the fix/#14805 branch February 7, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

“SourceTab error” dialog immediately appears after clicking OK in "Error Occurred" dialog, blocking further interaction.

4 participants