Commit c95a89c
committed
devices: invalidate device cache on device-removed event
Avoid returning old device when it got removed already. This also
(hopefully) fixes event handlers getting VirtualDevice instead of real
one:
Failed to handle event: sys-usb, device-added:usb, {'device': sys-usb+4-1:0bda:8179:00E04C0001:uffffff}
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/qubesadmin/events/__init__.py", line 278, in handle
kwargs['device'] = plugged
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.13/site-packages/qui/devices/device_widget.py", line 262, in device_added
dev = backend.Device(device, self)
File "/usr/lib/python3.13/site-packages/qui/devices/backend.py", line 156, in __init__
for interface in dev.interfaces:
^^^^^^^^^^^^^^
AttributeError: 'VirtualDevice' object has no attribute 'interfaces'1 parent 9c733d8 commit c95a89c
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
260 | 266 | | |
261 | 267 | | |
262 | 268 | | |
| |||
0 commit comments