keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
21.43k stars 1.48k forks source link

Going to application settings and back to entry view disables several context menu items #10981

Closed Almandor closed 1 month ago

Almandor commented 5 months ago

Overview

I don't want the TOTP not being visible to anybody just looking on my screen. But when I disable the TOTP in the Preview the TOTP and Copy Attribute elements in the context menu are grayed out.

Steps to Reproduce

  1. Add TOTP to one entry
  2. Open Settings - Security
  3. Select "Hide TOTP in the entry preview panel"
  4. Save the settings
  5. Right click on your Entry which has a TOTP
  6. Check status of TOTP and Copy Attribute

Expected Behavior

Should behave the same way as when the setting was not active. Both context menu entries should work.

Actual Behavior

Both context manu entries are disabled

Context

KeePassXC - Version 2.7.8 Revision: f6757d3 Distribution: Snap

Qt 5.15.11 Debugging mode is disabled.

Operating system: Ubuntu Core 22 CPU architecture: x86_64 Kernel: linux 6.8.0-35-generic

Enabled extensions:

Cryptographic libraries:

Operating System: Linux - Ubuntu Desktop Env: Gnome Windowing System: Wayland

varjolintu commented 5 months ago

Seems if you disable the setting after enabling it, the context menu entries will not activate again.

varjolintu commented 4 months ago

If you edit the entry, the context menu is brought back after leaving the dialog. When the error happens Entry::hasTotp() returns false, so something strange happens to m_data.totpSettings?

droidmonkey commented 4 months ago

Just going into application settings and back out again disables the context menu entries. This has nothing to do with the TOTP preview panel settings.

0xdeadbeer commented 4 months ago

May I tackle down this issue and provide a solution?

droidmonkey commented 4 months ago

Sure if you can find it, I am currently at a loss.

I just checked way back to 2.6.6 and the bug was still present. It seems to have gotten "worse" recently as 2.7.0 at least reset the state when you changed groups, that no longer happens. However, something is deeply flawed that is now becoming obvious.

droidmonkey commented 4 months ago

@0xdeadbeer recommend stop work. I just brought forward a major update that I did to the menu actions and it fixed the issue immediately. Will post PR, but this change needs some attention to incorporate newer actions that appeared since I worked on this last.

11047