Fix history items losing entry CustomData - #13573
Open
eric-lemesre wants to merge 2 commits into
Open
Conversation
Entry::beginUpdate() copied attributes, attachments and auto-type associations into the temporary history item but not CustomData, unlike clone() and copyDataFrom(). As a result every history item was created with empty CustomData, and restoring an entry from history wiped its CustomData, losing KeePassXC-Browser settings and other client metadata. Copy CustomData into the history item like the other components and add TestEntry::testHistoryItemCustomData covering creation and restore. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
droidmonkey
approved these changes
Aug 7, 2026
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.
Entry::beginUpdate()copies attributes, attachments and auto-type associations into the temporary history item, but notCustomData— unlikeclone()andcopyDataFrom(), which both copy it. As a result, every history item is created with emptyCustomData, and restoring an entry from history wipes the entry'sCustomData, silently losing KeePassXC-Browser settings and any other client metadata stored there.This PR copies
CustomDatainto the history item like the other components.One known limitation we would like your opinion on: history items created before this fix have no
CustomData, so restoring from those older items will still clear the entry'sCustomData. We did not find a safe way to repair existing history retroactively.Testing strategy
TestEntry::testHistoryItemCustomDatacovering both history item creation (CustomData carried over) and restore (CustomData restored).testentry,testmodified,testgroup,testkdbx2/3/4,testmerge,testcli,testbrowser— all passing.KeePass2Writeralready scans history items' CustomData for KDBX version selection, so no additional format version bump is introduced by this change.Type of change
AI usage disclosure
Per the contribution guidelines: development was done with Claude Code (model: Claude Fable 5, Anthropic); an additional critical code review pass was performed with Kimi-k3. All changes were reviewed, built and tested locally by the submitter.
We tried to keep this fix as small and focused as possible. If there are any changes you would like, or points we may have missed — particularly around merge/sync behaviour or the retroactive-history limitation — we would be glad to address them.
🤖 Generated with Claude Code