PhilippC / PhilippC/keepass2android
[BUG] Mutliple databases, first database open takes precedence regarding copied entries
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.2k
- Forks
- 478
- Avg merge
- 1h 4m
- Merged PRs (30d)
- 2
Description
Checks
- I have read the FAQ section, searched the open issues, and still think this is a new bug.
Describe the bug you encountered:
I have two databases that I use, database A and B. One of them is an older database that I rarely use - A. My more recently created database -B - has several entries that were copied over from database A. Even when the title of one of these copied entries has been updated in the newer database, I noticed that whichever database is loaded first is the one that is respected/displayed.
For example, I have an entry for "Laptop - Windows" in database A. I copied the entry over to database B, updated the title to "Laptop - Windows 11" and added additional string entries. This action created a new version dated several years after the last modification to this entry. Now if I select "Open another database" and open database A which has not been loaded recently and has no local backup, select the original entry "Laptop - Windows" - the modified version from database B is shown. If I reverse this by removing all databases from the list in the app and removing local backups as well, then open up database A first and subsequently database B, the "Laptop - Windows 11" entry that was modified will show the older version without the recent additional strings.
I suspect this is a quirk not many people will encounter due to the unlikelihood of someone copying entries from one database to another, but I presume it has something to do with the entry UUID being the same in both databases and the nature of how each entry is stored in memory.
Describe what you expected to happen:
I expected the respective entry to be shown for the database I was currently in, not the entry from the one opened prior. I assumed clicking "Open another database" meant that the database currently open would be "closed".
What version of Keepass2Android are you using?
1.14r1 - Offline version
Which version of Android are you on?
16
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by opening two databases containing copied entries with the same UUID, then reverse the order in which they are opened. Trace database switching and entry lookup to determine why one database's version is reused. Done means each database displays its own entry version after switching and reopening databases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, csharp
- Domain
- databases, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100