obsidian-gpgCrypt icon indicating copy to clipboard operation
obsidian-gpgCrypt copied to clipboard

Issues with the new Obsidian versions - repeated asking

Open oshev opened this issue 1 year ago • 18 comments

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!

oshev avatar Feb 13 '25 07:02 oshev

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.

tejado avatar Feb 13 '25 14:02 tejado

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.

oshev avatar Feb 13 '25 14:02 oshev

Great news - let me know if you encounter any further issues.

tejado avatar Feb 13 '25 14:02 tejado

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?

oshev avatar Feb 14 '25 06:02 oshev

* 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.

tejado avatar Feb 17 '25 13:02 tejado

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.

oshev avatar Feb 19 '25 11:02 oshev

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?

tejado avatar Feb 25 '25 20:02 tejado

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).

oshev avatar Mar 03 '25 09:03 oshev

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?

Image

georgjaehnig avatar Mar 14 '25 16:03 georgjaehnig

@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.

tejado avatar Mar 18 '25 14:03 tejado

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.

georgjaehnig avatar Mar 18 '25 15:03 georgjaehnig

@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.

georgjaehnig avatar Mar 24 '25 06:03 georgjaehnig

I will provide an update for the two issues in the next days:

  • Password Expiration
  • Better handling of the Decryption in progress popup

tejado avatar Mar 31 '25 14:03 tejado

@tejado Looking forward to it! Thank you for your work.

georgjaehnig avatar Apr 05 '25 23:04 georgjaehnig

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 avatar Apr 13 '25 19:04 tejado

@tejado Seems it is the core plugin Word count that caused my behavior. Switching it off and the problem is gone.

georgjaehnig avatar Apr 13 '25 20:04 georgjaehnig

@tejado I also use Word Count as @georgjaehnig and I really need it.

oshev avatar Apr 14 '25 10:04 oshev

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!

oshev avatar Apr 14 '25 11:04 oshev