Clear m_attemptingLock when a lock's autosave triggers a reload - #13733
Open
underclockeddev wants to merge 1 commit into
Open
underclockeddev wants to merge 1 commit into
underclockeddev wants to merge 1 commit into
Conversation
DatabaseWidget::lock() returned early when its autosave failed and a reload began, without clearing m_attemptingLock. Every later lock() then returned at the m_attemptingLock check, so the database could not be locked again until KeePassXC was restarted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
droidmonkey
approved these changes
Sep 30, 2026
Member
|
Nice find! |
This file contains hidden or 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
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.
Fixes #13732
DatabaseWidget::lock()setsm_attemptingLock, then autosaves a modified database. When that save fails and a reload has begun (the file changed on disk: "Database file has unmerged changes"), it returned early without clearingm_attemptingLock. Every laterlock()then returned at them_attemptingLockcheck, so the database could not be locked again until KeePassXC was restarted. Every other early return afterm_attemptingLock = truealready clears it; this one now does too.The investigation and patch were done with Claude Code (Claude Opus 5.5) and reviewed by me before submitting.
Screenshots
N/A
Testing strategy
developevery later lock is refused (8 of 8 runs). With this change each later lock asks the reload question again instead (3 of 3), and the script's control without an external change locks on both.ctestsuite (non-GUI) passes: 46/46.Type of change