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

Correct multiple issues with database saving #3991

Merged
merged 2 commits into from
Dec 15, 2019

Conversation

droidmonkey
Copy link
Member

@droidmonkey droidmonkey commented Dec 8, 2019

Type of change

  • ✅ Bug fix (non-breaking change which fixes an issue)

Description and Context

  • Mark the database as clean after fully completing the file save operation INSTEAD of when merely writing the database to a file.

  • Stop the modified timer when marking the database as clean, this prevents latent erroneous modified signals from being emitted.

  • Do not restart the modified timer after a new change is detected while it is still running.

  • Fix KeepassXC (Linux) crashing on Apply/OK/Cancel #3933 and fix Crash on macOS when stored in cloud service  #3857. Interaction with entries and groups is disabled while the database is being reloaded or saved to prevent changes from occurring. Prevent the database from being reloading if an entry or group is currently being edited.

  • Fix Merge popup randomly appears when kdbx file is on network share #3941 - Only notify components when the database file actually changes (determined by checksum). This prevents spurious merge requests when the file is merely touched by another service (e.g., DropBox).

Testing strategy

Currently testing on all platforms to confirm the above bugs are fixed.

Checklist:

  • ✅ I have read the CONTRIBUTING document. [REQUIRED]
  • ✅ My code follows the code style of this project. [REQUIRED]
  • ✅ All new and existing tests passed. [REQUIRED]
  • ✅ I have compiled and verified my code with -DWITH_ASAN=ON. [REQUIRED]
  • ✅ My change requires a change to the documentation, and I have updated it accordingly.
  • ✅ I have added tests to cover my changes.

* Mark the database as clean after fully completing the file save operation INSTEAD of when merely writing the database to a file.

* Stop the modified timer when marking the database as clean, this prevents latent erroneous modified signals from being emitted.

* Do not restart the modified timer after a new change is detected while it is still running.
* Fix #3933 and  fix #3857. Interaction with entries and groups is disabled while the database is being reloaded or saved to prevent changes from occurring. Prevent the database from being reloading if an entry or group is currently being edited.

* Fix #3941 - Only notify components when the database file actually changes (determined by checksum). This prevents spurious merge requests when the file is merely touched by another service (e.g., DropBox).

* Fix code format of ElidedLabel.cpp
// Lock out interactions
m_entryView->setDisabled(true);
m_groupView->setDisabled(true);
QApplication::processEvents();
Copy link
Member

Choose a reason for hiding this comment

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

The clean way would be to actually to save in the background and queue any changes done in the meantime.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a 2.6.0 change

@droidmonkey droidmonkey merged commit 8e76c30 into release/2.5.2 Dec 15, 2019
@droidmonkey droidmonkey deleted the fix/database-saving branch December 15, 2019 02:26
droidmonkey added a commit that referenced this pull request Jan 4, 2020
Added

- Browser: Show UI warning when entering invalid URLs [#3912]
- Browser: Option to use an entry only for HTTP auth [#3927]

Changed

- Disable the user interface when merging or saving the database [#3991]
- Ability to hide protected attribute after reveal [#3877]
- Remove mention of "snaps" in Windows and macOS [#3879]
- CLI: Merge parameter for source database key file (--key-file-from) [#3961]
- Improve GUI tests reliability on Hi-DPI displays [#4075]
- Disable deprecation warnings to allow building with Qt 5.14+ [#4075]
- OPVault: Use 'otp' attribute for TOTP field imports [#4075]

Fixed

- Fix crashes when saving a database to cloud storage [#3991]
- Fix crash when pressing enter twice while opening database [#3885]
- Fix handling of HTML when displayed in the entry preview panel [#3910]
- Fix start minimized to tray on Linux [#3899]
- Fix Auto Open with key file only databases [#4075]
- Fix escape key closing the standalone password generator [#3892]
- macOS: Fix monospace font usage in password field and notes [#4075]
- macOS: Fix building on macOS 10.9 to 10.11 [#3946]
- Fix TOTP setup dialog not closing on database lock [#4075]
- Browser: Fix condition where additional URLs are ignored [#4033]
- Browser: Fix subdomain matching to return only relevant site entries [#3854]
- Secret Service: Fix multiple crashes and incompatibilities [#3871, #4009, #4074]
- Secret Service: Fix searching of entries [#4008, #4036]
- Secret Service: Fix behavior when exposed group is recycled [#3914]
- CLI: Release the database instance before exiting interactive mode [#3889]
- Fix (most) memory leaks in tests [#3922]
@Bill-cpp
Copy link

When I upgraded KeePassXC from 2.4.3 to 2.5.1, I started encountering a strange problem upon saving my database into DropBox from Linux Mint: Although the database would be saved, I'd also get a pop-up window titled "File has changed", with message "The database file has changed. Do you want to load the changes?" I could type "yes" or "no". Either way, nothing remarkable happened. (This problem did not occur all the time, but nearly all the time.) Seeing this bug report, I figured my problem would be solved by this fix, so I recently upgraded to 2.5.3. Made no difference! I still get this gratuitous pop-up window. Is this part of the same problem, or what? I'm currently running Mint 19.3.

@droidmonkey
Copy link
Member Author

droidmonkey commented Jan 27, 2020

Please create a new issue with your exact environment and replication steps. I tested this with Dropbox on Ubuntu and macOS and found the issue to be corrected.

@phoerious phoerious added pr: bugfix Pull request that fixes a bug and removed bug labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority 🚨 pr: bugfix Pull request that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants