-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opening a file removes duplicate keywords and triggers lib changed #9216
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nice! My opinion: the writer should write, not modify anything. All cleanup / migrations / other changes should happen before the actual write and directly (and only) modify the in-memory library. |
I generally agree with you. Writing and reading the bibtex is not the problem. The migration is done on startup. But I will check if I can find a way to make a set of the keywords before writing |
Co-authored-by: Christoph <siedlerkiller@gmail.com> Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Co-authored-by: Houssem Nasri <housi.housi2015@gmail.com>
Siedlerchr
changed the title
WIP: Opening a file removes duplicate keywords and triggers lib changed
Opening a file removes duplicate keywords and triggers lib changed
Oct 10, 2022
Co-authored-by: Christoph <siedlerkiller@gmail.com> Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Co-authored-by: Houssem Nasri <housi.housi2015@gmail.com> Co-authored-by: ThiloteE <73715071+ThiloteE@users.noreply.github.com>
Siedlerchr
added a commit
that referenced
this pull request
Oct 13, 2022
* upstream/main: (42 commits) Place subgroups w.r.t. alphabetical ordering (#9228) DOAB Fetcher now fetches ISBN and imprint fields where possible (#9229) ISSUE-9145: implement isbn fetcher (#9205) Remove explicit javafx jmod stuff (#9245) New Crowdin updates (#9239) Support Arabic language (#9243) Process CLI arguments before starting gui (#9217) Update README Decision Records link (#9241) Opening a file removes duplicate keywords and triggers lib changed (#9216) New Crowdin updates (#9237) Add Ukrainian as language (#9236) Add ADR-0026 on using Swing's FileChooser (#9235) Log exception (#9227) Fix archunit (#9234) Bump tika-core from 2.4.1 to 2.5.0 (#9232) Check group type before showing dialog in edit group (#8909) Fix unexpected closing of preferences dialog (#9225) Fix typo in connection error message (#9226) Improve VSCode config (#9218) Searching for an entry on the web shouldn't take forever (#9199) ... # Conflicts: # build.gradle # lib/afterburner.fx.jar # src/main/java/org/jabref/cli/Launcher.java # src/main/java/org/jabref/gui/EntryTypeView.java # src/main/java/org/jabref/gui/auximport/FromAuxDialog.java # src/main/java/org/jabref/gui/bibtexextractor/ExtractBibtexDialog.java # src/main/java/org/jabref/gui/collab/ExternalChangesResolverDialog.java # src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.java # src/main/java/org/jabref/gui/contentselector/ContentSelectorDialogView.java # src/main/java/org/jabref/gui/customentrytypes/CustomizeEntryTypeDialogView.java # src/main/java/org/jabref/gui/documentviewer/DocumentViewerView.java # src/main/java/org/jabref/gui/edit/ManageKeywordsDialog.java # src/main/java/org/jabref/gui/entryeditor/EntryEditor.java # src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationTabView.java # src/main/java/org/jabref/gui/errorconsole/ErrorConsoleView.java # src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogView.java # src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogView.java # src/main/java/org/jabref/gui/help/AboutDialogView.java # src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.java # src/main/java/org/jabref/gui/importer/ImportEntriesDialog.java # src/main/java/org/jabref/gui/integrity/IntegrityCheckDialog.java # src/main/java/org/jabref/gui/libraryproperties/AbstractPropertiesTabView.java # src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesView.java # src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesView.java # src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesView.java # src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesView.java # src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesView.java # src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogView.java # src/main/java/org/jabref/gui/openoffice/ManageCitationsDialogView.java # src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java # src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java # src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java # src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.java # src/main/java/org/jabref/gui/preferences/externalfiletypes/EditExternalFileTypeEntryDialog.java # src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTab.java # src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTab.java # src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java # src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.java # src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.java # src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java # src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java # src/main/java/org/jabref/gui/texparser/ParseLatexDialogView.java # src/main/java/org/jabref/gui/texparser/ParseLatexResultView.java
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refs and I will hopefully find a way to fixes #9187
Fixed #8586
After a while debugging and adding tests everywhere I finally found the culprit. The keyword special field migration calls
removeKeywords on an entry and that internally calls getKeywords which returns only a Set and readds those
=> As this is now a Set: Poof our duplicate keywords are gone and the library has changed
Questions to decide: Remove duplicate keywords on save? Probably easiest solution
Refactor migration to keep duplicates?
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)