KeePassDX icon indicating copy to clipboard operation
KeePassDX copied to clipboard

Database locks when writing a note

Open artistic-nucleus opened this issue 2 years ago • 2 comments

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

  • Created with: KeePassDX 3.4.5
  • Version: 2
  • Location: Local database
  • Contains attachment: No

KeePassDX:

  • Version: 3.4.5
  • Build: F Droid

Android:

  • Version: 11

artistic-nucleus avatar Jul 25 '22 10:07 artistic-nucleus

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.

J-Jamet avatar Jul 28 '22 18:07 J-Jamet

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)

Gabr-F avatar Sep 22 '22 00:09 Gabr-F