Fix not on fx thread exceptions for cleanup and cite key generator#15424
Conversation
Use callback to run changes on fx thread
Review Summary by QodoFix threading exceptions in citation key generation and cleanup operations
WalkthroughsDescription• Fix "not on FX thread" exceptions in citation key generation and cleanup operations • Separate expensive computations from field mutations using callback scheduler • Route BibEntry field mutations to JavaFX thread via UiTaskExecutor • Add mutationScheduler parameter to CleanupJob interface for thread-safe mutations Diagramflowchart LR
A["Background Thread<br/>Computation"] -->|"expensive logic"| B["Mutation Scheduler<br/>Callback"]
B -->|"field mutations"| C["FX Thread<br/>ObservableMap Updates"]
C -->|"fires listeners"| D["UI Listeners<br/>Safe Execution"]
File Changes1. jabgui/src/main/java/org/jabref/gui/citationkeypattern/GenerateCitationKeyAction.java
|
This comment has been minimized.
This comment has been minimized.
✅ All tests passed ✅🏷️ Commit: ed79df7 Learn more about TestLens at testlens.app. |
subhramit
left a comment
There was a problem hiding this comment.
Approving as no pending comments/requests
…abRef#15424) * Fix not on fx thread exception in citation key generator * Fix not on fx thread exception in citation key generator and cleanup Use callback to run changes on fx thread * checkstyle * remove comment
…o fix-group-icons * 'fix-group-icons' of github.com:geovani-rocha/jabref: (26 commits) chore(deps): update dependency org.apache.logging.log4j:log4j-to-slf4j to v2.25.4 (JabRef#15436) chore(deps): update jackson monorepo to v3.1.1 (JabRef#15435) Fix PushToPreferences reset and import (JabRef#15395) Add fulltext fetcher for Wiley via their TDM API (JabRef#15388) Embed in-text nature in reference marks for CSL citations (JabRef#15381) Chore(deps): Bump com.gradleup.shadow:shadow-gradle-plugin (JabRef#15430) Fix not on fx thread exceptions for cleanup and cite key generator (JabRef#15424) Revert "Update gradle to nightly of 2026-03-23 (JabRef#15372)" feat: add benchmarks for Lucene fulltext search and linked file indexing, including setup and teardown of the index. (JabRef#15385) Chore(deps): Bump org.openrewrite.recipe:rewrite-recipe-bom (JabRef#15418) Add claude gitignore (JabRef#15413) Fix group filter icon in side pane (JabRef#15408) Add new prs_link feature Chore(deps): Bump org.glassfish.hk2:hk2-api in /versions (JabRef#15422) Chore(deps): Bump org.openrewrite.rewrite from 7.28.2 to 7.29.0 (JabRef#15419) Chore(deps): Bump jablib/src/main/resources/csl-styles (JabRef#15417) Fix for inconsistent "hide tab bar" behavior (JabRef#15409) Update dependency org.glassfish.hk2:hk2-utils to v4 (JabRef#15407) Persist file notifications (JabRef#15403) Update dependency org.glassfish.hk2:hk2-locator to v4 (JabRef#15405) ...
…abRef#15424) * Fix not on fx thread exception in citation key generator * Fix not on fx thread exception in citation key generator and cleanup Use callback to run changes on fx thread * checkstyle * remove comment

Related issues and pull requests
Closes #15366
Closes https://github.com/JabRef/jabref-issue-melting-pot/issues/1165
PR Description
Key problem is that mutations to bib entry are not on FX thread in certain places but we have UI bound listeners that interact based on the field data
Introduced a callback to fix this and split up
Used Claude to implement the changes
Steps to test
Generate citation key
Run cleanup operations
Do not see any exceptions
Checklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)