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

Backupmanager: Include check for TimeStamp at .bak files #9089

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

koppor
Copy link
Member

@koppor koppor commented Aug 23, 2022

In case a .bak is older than a .bib - and it differs, a dialog is shown. This is not OK in a scenario, where git tooling, cloud synchronization or manual editing of the file was done. Thus, this PR adds checks for timestamps.


  • Change in CHANGELOG.md described in a way that is understandable for the average user (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 developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@ThiloteE ThiloteE changed the title Include check for TimeStamp at .bak files Backupmanager: Include check for TimeStamp at .bak files Aug 23, 2022
@Siedlerchr
Copy link
Member

Isn't the backup always older than the bib file?

@calixtus
Copy link
Member

Not if onedrive, Dropbox, git or the user messes with the modification dates of the files.

@Siedlerchr Siedlerchr merged commit f6928d2 into main Aug 24, 2022
@Siedlerchr Siedlerchr deleted the fix-bak-detection branch August 24, 2022 18:52
Siedlerchr added a commit that referenced this pull request Sep 2, 2022
* upstream/main: (387 commits)
  Show a warning in the merge dialog when authors are the same but formatted differently (#9088)
  Fix subdatabase from aux on cli (#9117)
  Visual improvements to LinkedFilesEditor (#9114)
  SLR Remove "last-search-date" (#9116)
  Hide diffs when one of the field values is blank a.k.a no conflict (#9110)
  Squashed 'buildres/csl/csl-locales/' changes from e637746677..b2afeb4d87
  Squashed 'buildres/csl/csl-styles/' changes from c750b6e..8d69f16
  Fix title case capitalization after en-dash characters (#9102)
  Update journal abbrev list (#9109)
  Fix CSL rendering in case of article (#8607)
  [WIP][GSOC22] - C - Improve the external changes resolver dialog (#9021)
  Bump jsoup from 1.15.1 to 1.15.3 (#9103)
  Bump checkstyle from 10.3.2 to 10.3.3 (#9104)
  Bump postgresql from 42.4.2 to 42.5.0 (#9105)
  Bump unirest-java from 3.13.10 to 3.13.11 (#9106)
  Include check for TimeStamp (#9089)
  Close OO connection on JabRef exit (#9076)
  Bump slf4j-tinylog from 2.4.1 to 2.5.0 (#9085)
  Bump bcprov-jdk18on from 1.71 to 1.71.1 (#9079)
  Bump tinylog-impl from 2.4.1 to 2.5.0 (#9086)
  ...

# Conflicts:
#	src/main/java/org/jabref/gui/shared/SharedDatabaseUIManager.java
#	src/main/java/org/jabref/gui/util/DefaultTaskExecutor.java
#	src/main/java/org/jabref/logic/shared/DBMSSynchronizer.java
@HoussemNasri
Copy link
Member

I have the backupFileDiffers test failing locally. I logged the last modified time for the original and the backup files, and they are equal. After investigation, it turns out that Gradle was really fast and was able to compile both files at the same time, so both files were copied from the production resources folder to the build resources folder at the same exact time. Which led to the timestamp comparison returning 0 and eventually backupFileDiffers returning false.

After cleaning gradle cache and running the test again, this time it passed (For some reason, gradle was a little slower this time). I don't really have any fixes or suggestions. This seemed like the best place to document the problem in case it occur in production.

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.

Improve .bak detection
5 participants