Issues with the new Obsidian versions - repeated asking
Hi. The plugin worked fine until a few Obsidian versions back. Now there are some issues:
- It sometime asks me password again even when I'm still editing the note (I have 5 minute timeout).
- Sometimes it suddenly asks me to enter the password when I don't have any encrypted note open.
- It asks me password several times even when I input it correctly. Typically, every time I open the note, I have to input the password 3 times before the plugin accepts it. Yes, I know that I input the password correctly. It happens EVERY time.
Please, take a look. It's the best ecryption plugin for Obsidian we have, and it used to work perfectly. Thank you!
Hi @oshev can you please check which Obsidian and plugin version you are using? There were a couple of fixes regarding this in the last weeks by me.
Hi! I appreciate your quick response. I'm using Obisdian 1.8.4 and gpgCrypt 0.2.0. I thought the pluging are updated automatically with the editor. Apparently, it' s not the case. I've just upgraded to gpgCrypt 0.4.0 and it seems the main issue (inputting the same password multiple times) is fixed! Thank you so much! I'll test it further with regards to other problems and update the issue if necessary.
Great news - let me know if you encounter any further issues.
Hi, sorry, there are still some issues. The bug of the plugin asking to input the same password multiple times is fixed indeed. I can open notes typing the password only once. However, two other issues are still there, unfortunately:
- The plugin sometimes asks my password again when I'm still editing the note (I have 5 minute timeout). Sometimes it happens in the middle of my typing in the encrypted note. I think it just doesn't register that the note is being edited and times out 5 minutes regardless.
- Sometimes it suddenly asks me to enter the password when I don't have any encrypted note open.
Could you, please, take a look?
* The plugin sometimes asks my password again when I'm still editing the note (I have 5 minute timeout). Sometimes it happens in the middle of my typing in the encrypted note. I think it just doesn't register that the note is being edited and times out 5 minutes regardless.
The passphrase expiration is only bound on the time when it was entered. Any activits, e.g. editing a note does not reset the expiration timer. Would it make sense from your perspective to add a option to reset the expiration timer when an encrypted note was written?
* Sometimes it suddenly asks me to enter the password when I don't have any encrypted note open.
Do you use any plugins that might access encrypted notes? gpgCrypt works by hooking into the internal Obsidian read/write functions and with that, if another plugin or Obsidian itself tries to read files in the background, you will get asked for the passphrase if its an encrypted one.
The passphrase expiration is only bound on the time when it was entered. Any activits, e.g. editing a note does not reset the expiration timer.
Thanks for clarifying, this is strange, though. I didn't have this issue in the past. I don't remember Obisidan asking me for the password every few minutes.
Would it make sense from your perspective to add a option to reset the expiration timer when an encrypted note was written?
I think so. I just don't want to extend expiration time beyond a few minutes for security, but entering the password every several minutes, while I'm still writing in the encrypted note, doesn't make sense.
if another plugin or Obsidian itself tries to read files in the background, you will get asked for the passphrase if its an encrypted one.
I only have 5 plugins including gpgCrypt and none of them should be scanning the notes. I haven't seen this behaviour until recently.
Obsidian changed few internals that is causing a file read after writing. And a file read needs to decrypt (-> passphrase has to be entered). So yeah, the only chance I see is to add an option that the passphrase cache timer is resetted if the same file is changed over time.
Regarding the second point: can you provide me a way to reproduce this?
Sorry for a delay in my reply.
Obsidian changed few internals that is causing a file read after writing. And a file read needs to decrypt (-> passphrase has to be entered). So yeah, the only chance I see is to add an option that the passphrase cache timer is resetted if the same file is changed over time.
That sounds good. Could you implement this?
Regarding the second point: can you provide me a way to reproduce this?
Try to open an encrypted note. Edit it long enough that it asks a password you again. Input the password and then close the note in a few minutes. Start editing another note (without any encrypted note open). It should ask you the password again after the timeout. (Don't forget to set the time out, i.e., 1 minute for tests).
I had the same issue before (repeated asking for password from gpg-agent), then updated to the newest version (0.4.0).
Now, while editing an encrypted file I keep getting this message, it just flashes for less than a second, disappears, and comes back after some more editing. Is there a way to get rid of it?
@oshev I will provide a fix for this. Regrding the second point - I will check this further.
@georgjaehnig This would be a separate topic. Yeah, it might be confusing to have this poping up during edits - thanks for the feedback. I introduced this in case additional actions are necessary by gpg CLI (e.g. touching the yubikey to allow the operation). I can add a feature to hide this dialog.
Yeah, it might be confusing to have this poping up during edits - thanks for the feedback. I introduced this in case additional actions are necessary by gpg CLI (e.g. touching the yubikey to allow the operation). I can add a feature to hide this dialog.
Thanks, Just to let you know: The dialog appears sometimes every 3-5 keystrokes. So there must be a lot of file operations running in the background, not sure if this is normal.
@tejado I'd really appreciate if you could soon release just a minor upgrade that allows to hide the "Decryption in progress" info.
Currently, I am practically blocked from editing all my encrypted notes as this info keeps appearing after every 3-5 keystrokes.
I will provide an update for the two issues in the next days:
- Password Expiration
- Better handling of the Decryption in progress popup
@tejado Looking forward to it! Thank you for your work.
Unfortunately, Im not able to reproduce your mentioned behaviour. Could you specify what other plugins you are using or even better: disabling other plugins to narrow it down to a specific one, @georgjaehnig & @oshev ?
Nevertheless, I added the both settings, please check gpgCrypt 0.5.0: releases/tag/0.5.0
@tejado Seems it is the core plugin Word count that caused my behavior. Switching it off and the problem is gone.
@tejado I also use Word Count as @georgjaehnig and I really need it.
I tested "Restart passphrase timeout on save", the option you added, @tejado. It works well. I'm no longer asked for the password while editing the note. Thank you very much!