From ae4a1e30abf54ff4834c01dc798d4e5fb3c529f0 Mon Sep 17 00:00:00 2001 From: DeeJanuz <45082401+DeeJanuz@users.noreply.github.com> Date: Sat, 3 Oct 2026 08:37:15 -0600 Subject: [PATCH] update-check: a still controller isn't a broken web socket vrserver sends a controller's state only when something on it changes, and one lying still or asleep may not even send its first one. The check subscribed to one controller and failed after 3 s of silence. It now subscribes to all, and silence after a good handshake is a skip. Co-Authored-By: Claude Opus 5.5 --- scripts/update-check.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/update-check.py b/scripts/update-check.py index c90fe71..f64323a 100755 --- a/scripts/update-check.py +++ b/scripts/update-check.py @@ -393,18 +393,24 @@ def check_vr_socket(): report("FAIL", label, "vrserver refused the web socket; the pause gesture can't read the controllers") return mailbox = f"frametop_check_{os.getpid()}" - for text in (f"mailbox_open {mailbox}", "mailbox_send input_server " + json.dumps( - {"type": "request_input_state_updates", "device_path": found[0]["root_path"], - "returnAddress": mailbox})): + # Every controller: one lying still (or asleep) may send nothing at all. + for text in [f"mailbox_open {mailbox}"] + ["mailbox_send input_server " + json.dumps( + {"type": "request_input_state_updates", "device_path": d["root_path"], "returnAddress": mailbox}) + for d in found]: payload, mask = text.encode(), os.urandom(4) size = bytes([0x80 | len(payload)]) if len(payload) < 126 else bytes([0x80 | 126]) + struct.pack(">H", len(payload)) s.sendall(b"\x81" + size + mask + bytes(b ^ mask[i % 4] for i, b in enumerate(payload))) deadline = time.monotonic() + 3 - while b"update_component_states" not in data and time.monotonic() < deadline: - chunk = s.recv(65536) - if not chunk: - break - data += chunk + try: + while b"update_component_states" not in data and time.monotonic() < deadline: + chunk = s.recv(65536) + if not chunk: + break + data += chunk + except socket.timeout: + report("skip", label, "it took the subscription, but no controller sent anything in 3 s " + "(lying still or asleep?): pick one up and check again") + return except OSError as e: report("FAIL", label, f"{e}; the pause gesture can't read the controllers") return