Kunzisoft / KeePassDX

Lightweight vault and password manager for Android, KeePassDX allows editing encrypted data in a single file in KeePass format and fill in the forms in a secure way.
https://www.keepassdx.com/
GNU General Public License v3.0
4.35k stars 262 forks source link

Database locks when writing a note #1366

Open artistic-nucleus opened 2 years ago

artistic-nucleus commented 2 years ago

Describe the bug I have some notes in a local database. I've setup the database to auto lock after 5 minutes of inactivity. In case I'm editing a note and the timer runs out, the database is locked without saving the changes. This happens only when 'Notes' is selected in templates. It does not happen with other entry types

To Reproduce

Steps to reproduce the behavior:

  1. Set a timer to auto lock database
  2. Add a new entry and select 'Notes' as entry type.
  3. Edit the note till timer ends
  4. The database will close automatically without saving the changes

Expected behavior

Either the database should be saved before closing, or the database should not lock until the note is saved, just like other entry tyoes

KeePass Database

KeePassDX:

Android:

J-Jamet commented 1 year ago

There is no relation with the type of template and the reset of the timer.

I can't force the database to be saved during a lock attempt because it would stop the lock. Here the timer reset event is triggered when you enter the text field, but there is no event that resets the timer when you enter text, this is a choice that has been made. Otherwise there would be too many events to manage.

This may be a behavior to improve later but is not very urgent.

Gabr-F commented 1 year ago

I can't force the database to be saved during a lock attempt because it would stop the lock. Here the timer reset event is triggered when you enter the text field, but there is no event that resets the timer when you enter text, this is a choice that has been made. Otherwise there would be too many events to manage.

This is just a technical problem, right, in that with the current code saving the database stops the lock timer?

I can imagine the frustration in losing text, yes one could learn to write outside the app and then copy-paste, but still, for the first times it happens...

What about pausing the timer when the focus is still on a field? Is it maybe inadvisable because it's not always possible to detect when the focus is changed? (I don't know if it's so)

Maybe a warning could be issued when it's likely that the user is still in the field, giving him 10 seconds to reset the timer (and hopefully saving and then locking the database if he doesn't)