Bug 504530

Summary: Bluetooth: "Forget this Device" popup should pop/close the device's page
Product: [Applications] systemsettings Reporter: ratijas <me>
Component: kcm_bluetoothAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: 4wy78uwh, nate, nowrep
Priority: NOR    
Version First Reported In: 6.3.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 6.6.0
Sentry Crash Report:
Attachments: Bluetooth - Forget this Device

Description ratijas 2025-05-19 14:43:47 UTC
Created attachment 181515 [details]
Bluetooth - Forget this Device

SUMMARY
After "forgetting" a bluetooth device, the KCM page for the device stays open, but the device object is gone, so every control on the page (except the Back button) is broken/explodes with errors at this point.

STEPS TO REPRODUCE
1. Open device's settings
2. Forget button -> Forget this Device
3. Interact with any controls on the page

OBSERVED RESULT
Nothing works or even makes sense. The broken page generates various errors all related to the fact that the Device object is gone:

qrc:/kcm/kcm_bluetooth/ForgetDeviceAction.qml:17: TypeError: Cannot read property 'name' of null
qrc:/kcm/kcm_bluetooth/Device.qml:180: TypeError: Cannot read property 'uuids' of null
qrc:/kcm/kcm_bluetooth/Device.qml:168: TypeError: Cannot read property 'blocked' of null
qrc:/kcm/kcm_bluetooth/Device.qml:159: TypeError: Cannot read property 'trusted' of null
qrc:/kcm/kcm_bluetooth/Device.qml:152: TypeError: Cannot read property 'name' of null
qrc:/kcm/kcm_bluetooth/Device.qml:147: TypeError: Cannot read property 'adapter' of null
qrc:/kcm/kcm_bluetooth/Device.qml:142: TypeError: Cannot read property 'address' of null
qrc:/kcm/kcm_bluetooth/Device.qml:136: TypeError: Cannot read property 'battery' of null
qrc:/kcm/kcm_bluetooth/Device.qml:137: TypeError: Cannot read property 'battery' of null
qrc:/kcm/kcm_bluetooth/script.js:11: TypeError: Cannot read property 'type' of null
qrc:/kcm/kcm_bluetooth/Device.qml:109: TypeError: Cannot read property 'connected' of null
qrc:/kcm/kcm_bluetooth/Device.qml:112: TypeError: Cannot read property 'blocked' of null
qrc:/kcm/kcm_bluetooth/Device.qml:108: TypeError: Cannot read property 'connected' of null
qrc:/kcm/kcm_bluetooth/Device.qml:94: TypeError: Cannot read property 'icon' of null
qrc:/kcm/kcm_bluetooth/Device.qml:27: TypeError: Cannot read property 'name' of null
qrc:/kcm/kcm_bluetooth/Device.qml:107: TypeError: Cannot read property 'blocked' of null
qrc:/kcm/kcm_bluetooth/Device.qml:115: TypeError: Cannot read property 'connected' of null
qrc:/kcm/kcm_bluetooth/Device.qml:153: TypeError: Value is null and could not be converted to an object
qrc:/kcm/kcm_bluetooth/Device.qml:160: TypeError: Cannot read property 'trusted' of null
qrc:/kcm/kcm_bluetooth/Device.qml:169: TypeError: Cannot read property 'blocked' of null
qrc:/kcm/kcm_bluetooth/ForgetDeviceDialog.qml:74:17: QML Connections: Detected function "onAdapterRemoved" in Connections element. This is probably intended to be a signal handler but no signal of the target matches the name.
qrc:/kcm/kcm_bluetooth/ForgetDeviceDialog.qml:74:17: QML Connections: Detected function "onPoweredChanged" in Connections element. This is probably intended to be a signal handler but no signal of the target matches the name.
qrc:/kcm/kcm_bluetooth/ForgetDeviceDialog.qml:75: TypeError: Cannot read property 'adapter' of null
qrc:/kcm/kcm_bluetooth/ForgetDeviceDialog.qml:35: TypeError: Cannot read property 'name' of null
qrc:/kcm/kcm_bluetooth/ForgetDeviceDialog.qml:63: TypeError: Cannot read property 'adapter' of null


EXPECTED RESULT
The page should be automatically popped from the stack.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.6-arch1-1 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Android, for example, automatically pops back the navigation stack after its functionally identical popup.
Comment 1 Bug Janitor Service 2025-05-19 16:35:55 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/bluedevil/-/merge_requests/209
Comment 2 Nate Graham 2025-10-30 21:16:23 UTC
Git commit b57def97b6a79b11fbf166e81f677952f0816eb5 by Nate Graham, on behalf of ivan tkachenko.
Committed on 30/10/2025 at 21:12.
Pushed by ngraham into branch 'master'.

KCM: Pop the Device page when the device becomes unavailable

Pretty much copy-pasted from ForgetDeviceDialog.qml
FIXED-IN: 6.6.0

M  +23   -0    src/kcm/ui/Device.qml

https://invent.kde.org/plasma/bluedevil/-/commit/b57def97b6a79b11fbf166e81f677952f0816eb5