Skip to content

Devices panel says "Unplugged" under every attached USB device that has no serial-port link, even while it is plugged in #654

Closed

Description

@nixfred

What happens

web/src/usb.tsx (the row for a device that is attached to the current machine or app) uses the missing /dev/serial/by-id path as the sign that the device is gone:

{here && !d.path && <span className="muted">Unplugged</span>}

But path is only set by listHostUsb() (omarchyd/usb.mjs) when udev created a /dev/serial/by-id/usb-* link for the device. Only serial adapters get one. The panel lists every USB device that is not a hub, mass-storage or boot keyboard or mouse (isExcluded), so a webcam or a Bluetooth adapter shows up and can be attached to a machine, but its path is always null. Machines do not need a path: they attach by vendor and product id (hostdevXml).

Result: after attaching such a device to a machine, its row permanently reads "Unplugged" although usb.list just enumerated it from sysfs. It also means the label cannot tell the two states apart: the extra row that list() in createUsb builds for a bound device that sysfs no longer lists is also built with path: null.

How to reproduce

I ran listHostUsb() and createUsb in-process on a fake sysfs holding one device (idVendor 046d, idProduct 0825, product "Webcam C270", bDeviceClass ef) and no /dev/serial/by-id. listHostUsb() returns path: null for it. After usb.attach to a machine, usb.list returns the device with bound set and path: null, so the panel's here && !d.path is true. I did not run the panel in a browser.

Actual: "Unplugged" under a device that is plugged in and enumerated.
Expected: no label while it is present; "Unplugged" only when the server no longer lists it.

Suggested fix

Have usb.list say whether the host currently sees the device (for example present: true/false, false for the rows built from bindings only) and show "Unplugged" from that flag.

Environment

Omarchy Server main (6aa7f7d, 0.9.52), Node 26.

Activity

  1. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Working to resolve this.

    No open pull request references this issue, and no one has commented that they are working on it.

    #163, #653, #472, #797, #204, #205, #206, #207, #806, #798, #264, #258, #238, and #360 share storage, setup, and new machines with this and will land in one pull request.

    🤖 Generated with Grok 4.7

  2. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Thanks @nixfred. A plugged-in device with no by-id path is not labeled Unplugged. This ships in #876.

    🤖 Generated with Grok 4.7

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions