Skip to content

Fix : Replace blocking fetcher dialogs with notifications#15099

Merged
Siedlerchr merged 6 commits into
JabRef:mainfrom
faneeshh:fix-15097
Feb 14, 2026
Merged

Fix : Replace blocking fetcher dialogs with notifications#15099
Siedlerchr merged 6 commits into
JabRef:mainfrom
faneeshh:fix-15097

Conversation

@faneeshh

@faneeshh faneeshh commented Feb 11, 2026

Copy link
Copy Markdown
Collaborator

Closes #15097

PR Description

I replaced the blocking error and information dialogs in FetchAndMergeEntry with non intrusive notifications using the DialogService. This change ensures that when a bibliographic update fails like due to an invalid ISSN or server timeout, the user's workflow is not interrupted by a pop up that requires a manual click to dismiss.

Steps to test

  1. Open a library (e.g., the Chocolate.bib mentioned in the issue).
  2. Select an entry with an invalid or missing identifier (like an ISSN).
  3. Right click the entry and select Update bibliographic information.
  4. Observe that instead of a pop up dialog appearing, a notification toast appears at the bottom of the JabRef window describing the error.

Screenshots:

image

Checklist

  • I own the copyright of the code submitted and I license it under the [MIT license]
  • I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • I added screenshots in the PR description
  • I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • I checked the [user documentation]

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

Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Replace blocking fetcher dialogs with notifications

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Replace blocking dialogs with non-intrusive notifications in bibliographic update process
• Improve user experience by eliminating workflow interruptions during fetch operations
• Apply consistent notification pattern across both ID-based and entry-based fetchers
Diagram
flowchart LR
  A["Fetch Operation"] --> B["Error Occurs"]
  B --> C["ID-Based Fetcher"]
  B --> D["Entry-Based Fetcher"]
  C --> E["Show Notification"]
  D --> E
  E --> F["Non-blocking User Experience"]
Loading

Grey Divider

File Changes

1. jabgui/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java ✨ Enhancement +4/-4

Replace blocking dialogs with notifications

• Replaced showInformationDialogAndWait() calls with notify() for ID-based fetcher errors
 (FetcherClientException, FetcherServerException, generic exceptions)
• Replaced showErrorDialogAndWait() call with notify() for entry-based fetcher errors
• Simplified notification messages by removing fetcher name from dialog titles

jabgui/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java


2. CHANGELOG.md 📝 Documentation +1/-0

Document notification change in changelog

• Added entry documenting the change from blocking dialogs to notifications in bibliographic update
 process
• Referenced issue #15097 for traceability

CHANGELOG.md


Grey Divider

Qodo Logo

@github-actions github-actions Bot added the good first issue An issue intended for project-newcomers. Varies in difficulty. label Feb 11, 2026
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

✅ 1. notify() exposes exception.getMessage() 📘 Rule violation ⛨ Security
Description
The new user-facing notification includes exception.getMessage(), which can leak internal/system
details to end users. Detailed error information should be kept in logs while user messages remain
generic.
Code

jabgui/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java[105]

+                                                                 dialogService.notify(Localization.lang("Error occurred %0", exception.getMessage()));
Evidence
PR Compliance IDs 4 and 3 require that user-facing errors not expose internal details and that
failures be handled safely; the new notification directly surfaces the exception message to the UI.

Rule 4: Generic: Secure Error Handling
Rule 3: Generic: Robust Error Handling and Edge Case Management
jabgui/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java[105-105]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A user-facing notification includes `exception.getMessage()`, which can leak internal/system details.
## Issue Context
This notification is shown to end users when fetching bibliographic information fails; detailed error information should be restricted to internal logs.
## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java[105-105]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Fetcher error lacks details 🐞 Bug ✓ Correctness
Description
The EntryBasedFetcher failure path now shows only a generic toast without the actual error reason or
guidance to check logs, making failures hard to diagnose. Since notify() toasts only display plain
text (no exception details), this is a UX/observability regression compared to the previous
exception dialog.
Code

jabgui/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java[191]

+                          dialogService.notify(Localization.lang("Error while fetching from %0", fetcher.getName()));
Evidence
On EntryBasedFetcher failure, the code logs the exception but shows a toast containing only the
fetcher name. JabRefDialogService.notify renders only the provided message text (no stack trace /
exception details), so users lose actionable context unless they know to inspect logs. Other parts
of the GUI either include the exception’s localized message in the toast or explicitly instruct
users to check the error log.

jabgui/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java[178-193]
jabgui/src/main/java/org/jabref/gui/JabRefDialogService.java[440-463]
jabgui/src/main/java/org/jabref/gui/fieldeditors/WriteMetadataToSinglePdfAction.java[68-81]
jabgui/src/main/java/org/jabref/gui/fieldeditors/CitationCountEditorViewModel.java[62-70]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`FetchAndMergeEntry.fetchAndMerge(BibEntry, EntryBasedFetcher)` now shows only a generic notification on failure (fetcher name only). Since `DialogService.notify` toasts display plain text (no exception details), users don’t get an actionable reason or guidance.
### Issue Context
Other GUI flows either:
- include `exception.getLocalizedMessage()` in the notification, or
- show a toast that explicitly points users to the error log.
### Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java[178-193]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

dialogService.notify(Localization.lang("Server not available"));
} else {
dialogService.showInformationDialogAndWait(Localization.lang("Fetching information using %0", idBasedFetcher.getName()), Localization.lang("Error occurred %0", exception.getMessage()));
dialogService.notify(Localization.lang("Error occurred %0", exception.getMessage()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Action required

1. notify() exposes exception.getmessage() 📘 Rule violation ⛨ Security

The new user-facing notification includes exception.getMessage(), which can leak internal/system
details to end users. Detailed error information should be kept in logs while user messages remain
generic.
Agent Prompt
## Issue description
A user-facing notification includes `exception.getMessage()`, which can leak internal/system details.

## Issue Context
This notification is shown to end users when fetching bibliographic information fails; detailed error information should be restricted to internal logs.

## Fix Focus Areas
- jabgui/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java[105-105]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@testlens-app

testlens-app Bot commented Feb 11, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 1003f5e
▶️ Tests: 11192 executed
⚪️ Checks: 50/50 completed


Learn more about TestLens at testlens.app.

@koppor

koppor commented Feb 11, 2026

Copy link
Copy Markdown
Member

Which AI system is this replacing - by* in the pr description?

@faneeshh

Copy link
Copy Markdown
Collaborator Author

Which AI system is this replacing - by* in the pr description?

Gemini it is

@jabref-machine

Copy link
Copy Markdown
Collaborator

Note that your PR will not be reviewed/accepted until you have gone through the mandatory checks in the description and marked each of them them exactly in the format of - [x] (done), - [ ] (yet to be done) or - [/] (not applicable). Please adhere to our pull request template.

@koppor

koppor commented Feb 11, 2026

Copy link
Copy Markdown
Member

We are currently not willing to adapt our scripts to AIs - thus, please, update the checklist syntax manually ^^

@faneeshh

Copy link
Copy Markdown
Collaborator Author

We are currently not willing to adapt our scripts to AIs - thus, please, update the checklist syntax manually ^^

Understood and fixed the syntax. Also the test that is failing, if I standardize both fetcher paths to use consistent notifications would that be sufficient?

@Siedlerchr

Copy link
Copy Markdown
Member

Fix the failing tests or we will close this PR

@faneeshh

Copy link
Copy Markdown
Collaborator Author

Fix the failing tests or we will close this PR

I'm working on it

faneeshh and others added 4 commits February 13, 2026 14:54
* upstream/main:
  Add names to output (JabRef#15102)
  Try other token
  Be less strict on ourselves
  Very short self unassigment text
  Fix review check
  Fix trigger
* upstream/main:
  Refine Automatic Field Editor filtering logic (fixes JabRef#15066) (JabRef#15094)
  Output URL to workflow
  Fix token
  Refine stats message
  Quick fix to reduce load on runners
  "Debug" output for assign-issue-action
  Streamline pr-comment.yml (and remove status: stale label)
  Feature provide insights citation fetcher (JabRef#15093)
  Automatic Grouping By Entry Type (JabRef#15081)
  Minor test fixes for arXiv (JabRef#15100)
  New Crowdin updates (JabRef#15101)
  recomment linked files handler (JabRef#15105)
  Chore(deps): Bump jablib/src/main/resources/csl-styles (JabRef#15087)
  Streamline binaries (JabRef#15085)
@Siedlerchr Siedlerchr enabled auto-merge February 14, 2026 17:19
@Siedlerchr Siedlerchr added this pull request to the merge queue Feb 14, 2026
@github-actions github-actions Bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Feb 14, 2026
Merged via the queue into JabRef:main with commit 5851742 Feb 14, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue An issue intended for project-newcomers. Varies in difficulty. status: changes-required Pull requests that are not yet complete status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update bibliographic information using identifier(s): Notfiy on wrong ISSN, not a dialog

4 participants