Skip to content

0029: Device names are picked at pairing, renamed in Settings

Status: Accepted (owner, 2026-11-24). Proposed (2026-11-17, owner asked for names; "identify it from device metadata")

Context

A paired device shows as "Device at " in Join, toasts and the PIN card when the router gives it no DNS name (the handheld today). Moonlight sends no useful metadata at pairing: devicename is a fixed string, the User-Agent names only the HTTP library, and the screen size arrives only with the first launch. A phone and a handheld can send the same launch size, so size alone cannot name a device. The owner also asked for a Settings place for the TV's own options ("the TV has options per app. We need couchdogs settings"), and the device list belongs there, not in an app's Options menu.

Decision

The PIN card asks "What is it?" with Handheld, Phone, Tablet, Laptop and PC, picked with the pad (default the request's DNS name if there is one, else Handheld); the LAN page's pairing form and ./couchdogs pair --name ask the same way. The server stores the pick as the client's name in clients.json; a name already in use gets a number ("Handheld 2"). A name is any text: the server drops control characters and Unicode's format characters (bidi overrides, invisible joiners), cuts it to 32 bytes and numbers it, so 32 bytes is a limit of bytes, not of letters. The pair socket gains devices (list paired devices: id, name), rename (id, name: the five kinds are what the TV offers, any text through the socket) and forget (remove the pairing; a stream already running is not cut). The TV's Settings page lists the devices under "Devices", with Rename and Forget; ./couchdogs devices|rename|forget does the same from a shell, for a host with no TV. The runner reads the name from the server at each launch, so Join lists and toasts follow a rename on the device's next connect.

Not chosen: guessing the kind from the launch size (wrong for a handheld at 1080p, and unknown at pairing); free text on the TV (typing with a pad); naming from the Moonlight client string (it is the same on every client).

Consequences

Pairing gains one pick. Devices paired before this keep their stored name until renamed, and a pairing imported from Wolf keeps its name. Names are user content shown on the TV, never logged with certificates. A rename reaches the device at its next connect where the screen is free: free means the screen is stopped (an idle stop leaves it stopped, not removed) or its owner had left and nobody else watches it (a device joined to it, or the TV showing it), and no app runs on it. A running screen with its owner still streaming from it is not free, because recreating a screen under a live stream would black its picture. A rename put off that way is remembered and logged once, not once per five-minute keepalive, and is applied at the next connect where the screen is stopped or its owner had left. Every home's Settings, the LAN page and ./couchdogs rename and forget (second amendment).

Amendment (2026-11-17): household rows on every Settings page

The owner found the handheld's Settings "still nearly empty": it showed only "Others can join this screen". Group apps by kind, Clock and About now show on every home's Settings page, with "This device" (its name, read only) on a device's page. A paired device is the household's (it paired through a PIN on the TV), so its page may change the two household values; the runner toasts the change on the TV ("Handheld set the clock to 12-hour"), which answers the original worry that the couch would see its home change with no way to tell why. Devices and Household password stay on the TV: a device's shell has no pair socket, and the password guards the LAN page.

Amendment (2026-11-18): every home is equal

Owner: "All devices are equal, or should be, except on the stuff like having touch or the fact that tv is direct hdmi." A household may have no TV, so nothing waits for one. Devices and Household password now show on every home's Settings page: device shells get the pair socket (couchdogs-pair) like the TV shell, so any home also shows the PIN card for a waiting device and can rename or forget one, and the password goes through the device path a device's wizard already uses. The LAN page lists, renames and forgets devices too. A household change is toasted on every other live home, the TV's own changes included, not only on the TV. Cost: any paired device can forget another device or change the password; a paired device is the household's, and it could already set the password in the first-run wizard. (The password part is superseded by 0031: that row is now "Sign-in code", and no home sets a password any more.)