Skip to content

fix(manager): survive a dropped pad path; keep the monitor alive#7

Merged
NicolasPogorzelski merged 1 commit into
mainfrom
fix/monitor-poll-crash
Jul 15, 2026
Merged

fix(manager): survive a dropped pad path; keep the monitor alive#7
NicolasPogorzelski merged 1 commit into
mainfrom
fix/monitor-poll-crash

Conversation

@NicolasPogorzelski

Copy link
Copy Markdown
Owner

Problem

During a disconnect/reconnect of all pads, _refresh_nodes drops an instance's path to None when the pad does not re-enumerate in time. The resting-colour watch then calls hidraw_for_event(None), which raised TypeError: expected str … not NoneType.

Worse, _monitor had no guard around _poll(), so that single exception killed the monitor thread for good: hotplug adoption, removal and LED updates all stopped silently while the D-Bus main loop kept answering menu clicks — the tray looked alive but never updated again (observed in the field 2026-07-15).

Fix

  • hidraw_for_event tolerates a None/empty path (returns []), matching led_indicator_for_event, whose callers already accept None.
  • _monitor wraps _poll in try/except: log the traceback and keep polling, so one transient error can never freeze the daemon again.

Tests

New tests/test_monitor_resilience.py: exercises the real hidraw_for_event(None), a ps5-native instance whose path went None surviving _apply_led/watch_holders, and _monitor continuing to poll after a raising _poll(). Full suite green.

During a disconnect/reconnect of all pads, _refresh_nodes drops an
instance's path to None when the pad does not re-enumerate in time. The
resting-colour watch then called hidraw_for_event(None), which raised
TypeError — and _monitor had no guard around _poll, so that single
exception killed the monitor thread for good: hotplug adoption, removal
and LED updates all stopped silently while the D-Bus main loop kept
answering menu clicks (modes still switched, nothing else updated).

- hidraw_for_event tolerates a None/empty path (returns []), matching
  led_indicator_for_event, whose callers already accept None.
- _monitor wraps _poll in try/except: log the traceback and keep polling
  so one transient error can never freeze the daemon again.
@NicolasPogorzelski
NicolasPogorzelski merged commit 336fe07 into main Jul 15, 2026
2 checks passed
@NicolasPogorzelski
NicolasPogorzelski deleted the fix/monitor-poll-crash branch July 15, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant