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
Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.
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
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 nowMath.max(readTimeoutMs, 10_000). It used to beMath.min(readTimeoutMs, 8000), which was 2.5 s by default. The terminal's/grow … switch uhubctlgoes through the same relay write, so it gets the longer wait too. - Test:
src/admin-relay.test.tshas a new case where the stub arm takes 400 ms to answer a uhubctl switch andreadTimeoutMsis 100. The page still redirects and shows thelightTriedtext. I shrank the timings instead of sleeping past 2.5 s so the test stays fast. - Checks:
admin-relay.test.tspasses (13 tests).bun x tsc --noEmitstill reports errors in other files, such assrc/ui/zone-notes.test.tsandsrc/visitor-counts.ts. None are inrelay.tsor this test. I didn't run the rest of the suite; the forge's check does that.
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:
- 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.
- 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.
Light writes through the relay now wait at least 10 s for the arm server. The owner now gets the
lightTriedflash instead of "the arm server did not answer" during a uhubctl try-out.src/relay.ts, the light write's timeout is nowMath.max(readTimeoutMs, 10_000). It used to beMath.min(readTimeoutMs, 8000), which was 2.5 s by default. The terminal's/grow … switch uhubctlgoes through the same relay write, so it gets the longer wait too.src/admin-relay.test.tshas a new case where the stub arm takes 400 ms to answer a uhubctl switch andreadTimeoutMsis 100. The page still redirects and shows thelightTriedtext. I shrank the timings instead of sleeping past 2.5 s so the test stays fast.admin-relay.test.tspasses (13 tests).bun x tsc --noEmitstill reports errors in other files, such assrc/ui/zone-notes.test.tsandsrc/visitor-counts.ts. None are inrelay.tsor this test. I didn't run the rest of the suite; the forge's check does that.Closes #637