Skip to content

Bluez.Client mode-transition Task should run supervised #57

Description

@bbangert

Found during the bluetooth-ui-api review (pre-existing, from the active/auto scanner work in PR #52 — not introduced by PR #56).

UniversalProxy.Bluez.Client.start_transition/3 spawns the passive↔active mode-transition Task with a bare Task.start/1. The inner try/rescue/catch covers raises and throws, but an external :kill (or OOM termination) bypasses it: the completion message never arrives, state.transition stays non-nil, and every subsequent set_mode/1 parks until the 32 s call timeout.

Fix: run it under a Task.Supervisor (the pattern Bluez.Gatt already uses for its BlueZ calls), or monitor the Task and treat a :DOWN without a completion message as a failed transition.

Same bare-Task.start pattern also pre-exists in uart/server.ex and uart/store.ex (lower stakes — fire-and-forget restarts, no state machine to wedge).

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions