Bug 470677

Summary: Cannot paste copied content (2FA code) after closing Authy app
Product: [Plasma] plasmashell Reporter: Lyubomir <liubomirwm>
Component: ClipboardAssignee: Plasma Bugs List <plasma-bugs>
Status: REPORTED ---    
Severity: normal CC: fella, nate, voidpointertonull+bugskdeorg
Priority: NOR Keywords: wayland
Version: 5.27.5   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=468422
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: After copy
After selecting code from clipboard tray list

Description Lyubomir 2023-06-05 17:22:19 UTC
SUMMARY
As instructed here https://bugs.kde.org/show_bug.cgi?id=468422#c13 filing new bug.

STEPS TO REPRODUCE
1. Install Authy and login https://authy.com/
2. Add some profiles
3. Copy the code via their button

OBSERVED RESULT
Copied code appears in the Plasma clipboard tray manager. Copied code can be pasted only until closing the Authy app. After closing can't paste.

EXPECTED RESULT
Successfully paste after closing Authy.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20230529
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 6.3.4-1-default (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i5-8250U CPU @ 1.60GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 620
Manufacturer: Acer
Product Name: Aspire A515-51G
System Version: V2.02
Comment 1 Lyubomir 2023-06-05 17:32:34 UTC
Created attachment 159480 [details]
After copy
Comment 2 Lyubomir 2023-06-05 17:32:58 UTC
Created attachment 159481 [details]
After selecting code from clipboard tray list
Comment 3 Nate Graham 2023-06-05 18:18:45 UTC
Is your clipboard history set to a size greater than 1?
Comment 4 Lyubomir 2023-06-05 23:09:56 UTC
It's set to 20 entries. Also Save history across desktop sessions.
Comment 5 Pedro V 2023-08-12 13:03:15 UTC
Didn't know about "qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole", that's really handy for looking into this kid of issues.

There are likely multiple issues here:
- Authenticators are supposed to keep the clipboard clean
- There might be an XWayland clipboard problem
- Klipper is not always showing what's actually on the clipboard

First one is not really feasible to check, so just guessing there, but I find it likely that Authy clears the clipboard on exit which is not a problem on its own, but it gets tricky combined with the Klipper problem.

XWayland is a bit trickier for me as it's surely riddled with odd issues and I'm trying to avoid it wherever possible, but I think I could reproduce the problem. Copied from a program using XWayland, exited, and even though the debug console didn't show a clipboard change, I could no longer paste the content even though it works before exiting.

Klipper is definitely misleading as it ignores some entries, mostly secrets and various attempts to clear the clipboard, resulting in showing stale clipboard content.
For example:
- Copy some text
- Run: wl-copy ""
- Observe Klippy still showing the copied text while the clipboard is already empty

I'm not too confident in my limited testing as I heavily prefer Wayland where I haven't seen this issue since I've realized that Klipper history size needs to be at least 1 (apparently it can't be even set to 0 anymore), so recommending attempting to isolate this problem to XWayland first.
Comment 6 Lyubomir 2023-08-12 21:56:10 UTC
If you want some logs or for me to test something feel free to share.