Bug 476551 - Clipboard is sent to phone when reconnecting after disabling clipboard autoshare
Summary: Clipboard is sent to phone when reconnecting after disabling clipboard autoshare
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (show other bugs)
Version: 23.08.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-04 15:25 UTC by Ditzy
Modified: 2024-03-31 14:48 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ditzy 2023-11-04 15:25:21 UTC
SUMMARY


STEPS TO REPRODUCE
1. Disable clipboard autoshare from pc.
2. Connect phone and pc.
3. Open KDE Connect pair new device screen on phone.
4. Disconnect pc from WiFi and wait until KDE Connect disappears from systray.
5. Copy some text.
6. Connect to WiFi and refresh pair new device screen on phone to reconnect.

OBSERVED RESULT
Clipboard is sent to phone.

EXPECTED RESULT
Clipboard not sent to phone.

SOFTWARE/OS VERSIONS
Phone: OnePlus Nord CE 2 Lite 5G
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11

ADDITIONAL INFORMATION
Comment 1 Will 2024-03-23 01:24:29 UTC
On the connection event, the current contents are unconditionally sent to the device:
https://github.com/KDE/kdeconnect-kde/blob/69d6c172142dbec0db4251ecb0aa0ecc2d194193/plugins/clipboard/clipboardplugin.cpp#L74

On the changed event (post-connection), the autoshare and password preferences are checked before the contents are sent:
https://github.com/KDE/kdeconnect-kde/blob/69d6c172142dbec0db4251ecb0aa0ecc2d194193/plugins/clipboard/clipboardplugin.cpp#L34
Comment 2 Bug Janitor Service 2024-03-25 00:23:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/660
Comment 3 Bug Janitor Service 2024-03-25 00:23:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/660
Comment 4 Bug Janitor Service 2024-03-25 08:45:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/661
Comment 5 Bug Janitor Service 2024-03-25 08:45:03 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/661
Comment 6 Bug Janitor Service 2024-03-25 09:01:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-android/-/merge_requests/419
Comment 7 Bug Janitor Service 2024-03-25 09:01:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-android/-/merge_requests/419
Comment 8 Albert Vaca Cintora 2024-03-31 14:48:16 UTC
Git commit 642c99056837053d943aa04ebd6a487c25d2bd56 by Albert Vaca Cintora, on behalf of Marx Zhu.
Committed on 31/03/2024 at 14:48.
Pushed by albertvaka into branch 'master'.

fix: do not send NetworkPacket if autoshare is disabled when connecting

M  +8    -1    plugins/clipboard/clipboardplugin.cpp

https://invent.kde.org/network/kdeconnect-kde/-/commit/642c99056837053d943aa04ebd6a487c25d2bd56