Skip to content
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

Fix newly added entry not synced to db #7178

Merged
merged 7 commits into from
Dec 14, 2020
Merged

Fix newly added entry not synced to db #7178

merged 7 commits into from
Dec 14, 2020

Conversation

Siedlerchr
Copy link
Member

@Siedlerchr Siedlerchr commented Dec 11, 2020

Fixes #7176
Should also fix #6944

Newly added entries have empty fields; don't update the field table to prevent SQL Exception
Fix shared entry not found by id
use left outer join for this

  • Change in CHANGELOG.md described (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

Newly added entries have empty fields; don't update the field table to prevent SQL Exception
Fix shared entry not found by id
use left outer join for this
@Siedlerchr Siedlerchr added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Dec 11, 2020
@Siedlerchr
Copy link
Member Author

I don't know why the documentation test fails

}
}

Map<String, String> expectedFieldMap = expectedEntry.getFieldMap().entrySet().stream().collect(Collectors.toMap((entry) -> entry.getKey().getName(), Map.Entry::getValue));
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this always an empty list (as expected entry is empty)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, seems like I need to adapt the queries a bit. Didn't think about this,
I should check for the shared entry id to be present.

Copy link
Member

Choose a reason for hiding this comment

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

To be honest, I've no idea what the test is doing. You add an empty entry, then some other completely unrelated entry, and then compare against the empty entry again.

@Siedlerchr Siedlerchr merged commit f356f9e into master Dec 14, 2020
@Siedlerchr Siedlerchr deleted the sharedDbInsert branch December 14, 2020 19:17
Siedlerchr added a commit that referenced this pull request Dec 21, 2020
* upstream/master: (33 commits)
  Bump archunit-junit5-api from 0.14.1 to 0.15.0 (#7220)
  Bump unoloader from 7.0.3 to 7.0.4 (#7214)
  Bump guava from 30.0-jre to 30.1-jre (#7218)
  Bump xmpbox from 2.0.21 to 2.0.22 (#7217)
  Bump classgraph from 4.8.94 to 4.8.97 (#7211)
  Bump byte-buddy-parent from 1.10.18 to 1.10.19 (#7216)
  Bump archunit-junit5-engine from 0.14.1 to 0.15.0 (#7215)
  Bump org.beryx.jlink from 2.22.3 to 2.23.0 (#7212)
  Add missing author
  Remove field check for journal abbrev in entry editor (#7208)
  Improvements for Entry Preview (in the context of #7083 and in addition to #7093) (#7185)
  Fix pdf content importer exception if DOI is empty (#7207)
  New translations JabRef_en.properties (Turkish) (#7204)
  New Crowdin updates (#7198)
  New Crowdin updates (#7192)
  Added missing test
  Changed tests to parameterized tests
  Extraction of Globals.prefs.put and .get (#7121)
  Fix newly added entry not synced to db (#7178)
  Bump org.eclipse.jgit from 5.9.0.202009080501-r to 5.10.0.202012080955-r (#7187)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
3 participants