Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

uhubctl try-out outlasts the relay's 2.5 s light write timeout: the card shows "the arm server did not answer" while the try-out succeeds #638

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

Light writes through the relay now wait at least 10 s for the arm server. The owner now gets the `lightTried` flash instead of "the arm server did not answer" during a uhubctl try-out.

shipped merged

opened this

Light writes through the relay now wait at least 10 s for the arm server. The owner now gets the lightTried flash instead of "the arm server did not answer" during a uhubctl try-out.

  • Fix: in src/relay.ts, the light write's timeout is now Math.max(readTimeoutMs, 10_000). It used to be Math.min(readTimeoutMs, 8000), which was 2.5 s by default. The terminal's /grow … switch uhubctl goes through the same relay write, so it gets the longer wait too.
  • Test: src/admin-relay.test.ts has a new case where the stub arm takes 400 ms to answer a uhubctl switch and readTimeoutMs is 100. The page still redirects and shows the lightTried text. I shrank the timings instead of sleeping past 2.5 s so the test stays fast.
  • Checks: admin-relay.test.ts passes (13 tests). bun x tsc --noEmit still reports errors in other files, such as src/ui/zone-notes.test.ts and src/visitor-counts.ts. None are in relay.ts or this test. I didn't run the rest of the suite; the forge's check does that.

Closes #637

commented

Light writes through the relay now wait at least 10 s for the arm server. The owner now gets the lightTried flash instead of "the arm server did not answer" during a uhubctl try-out.

  • Fix: in src/relay.ts, the light write's timeout is now Math.max(readTimeoutMs, 10_000). It used to be Math.min(readTimeoutMs, 8000), which was 2.5 s by default. The terminal's /grow … switch uhubctl goes through the same relay write, so it gets the longer wait too.
  • Test: src/admin-relay.test.ts has a new case where the stub arm takes 400 ms to answer a uhubctl switch and readTimeoutMs is 100. The page still redirects and shows the lightTried text. I shrank the timings instead of sleeping past 2.5 s so the test stays fast.
  • Checks: admin-relay.test.ts passes (13 tests). bun x tsc --noEmit still reports errors in other files, such as src/ui/zone-notes.test.ts and src/visitor-counts.ts. None are in relay.ts or this test. I didn't run the rest of the suite; the forge's check does that.
Approved

Approved. The light write now waits at least 10 s, so a uhubctl try-out (2 s off and back on) no longer shows "the arm server did not answer" while it succeeds. The change is one line and keeps the shape of the code around it. The new test uses a 400 ms stub against a 100 ms read timeout, so it fails on the old Math.min(readTimeoutMs, 8000) and passes now. The terminal /grow … switch uhubctl goes through the same write, so both doors get the fix. I did not run the tests or open the preview or its screenshots; this verdict rests on reading the diff and the surrounding code.

Two things I would do next:

  1. Tell the owner while the try-out runs. The page request now blocks for up to 10 s on a failure. A disabled button or a "switching…" note would stop double submits.
  2. Make the 10 s a named constant next to readTimeoutMs. It is a magic number, and the other raised timeouts (3000, 5000) are inline too.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs