Skip to content

state: a browser page closes a relay link that has gone silent, and dials again - #1546

Merged
transfix merged 2 commits into
masterfrom
feat/browser-reap-idle
Nov 26, 2026
Merged

transfix merged 2 commits into
masterfrom
feat/browser-reap-idle

Conversation

@transfix

@transfix transfix commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

The last open item from #1483. In the browser (wasm) build, the WebSocket transport's reap_idle did nothing. So a page whose relay, or the path to it, went away without closing kept a link that would never speak again, and arigl never dialed again. Native clients and the relay already close such a link (#1483). The relay still closed its own end, so the roster stayed right; only the page was stuck.

What changes

  • state_transport_ws::reap_idle in the browser closes and deletes a socket that has received nothing for the timeout. The relay pings every 2 s, so a live link is never that quiet. The socket is then no longer a link, so arigl's net_step (which already calls reap_idle each second) dials the relay again and re-asserts what it published. A backgrounded tab still answers the relay's Pings from onmessage, so it is not silent.
  • It also deletes the socket of a link the browser closed itself (its onclose has fired), and sweeps dead connections, which piled up over reconnects.

Test

  • arigl_web_smoke.mjs, new case: a fake relay on the test server (/apps/silent-relay) takes the upgrade, sends one empty frame and then nothing, and never closes. The page (/apps/silent/, a config that makes it a conference client of that relay) must log "closing a silent link" and dial a second time.
  • Run locally against the released arigl-web 4.0.9, without this change: the new case fails (relay opens 1, closes 0) and the other 25 pass. So the case catches the gap. CI's arigl-web job builds this branch's page and runs it.
  • CI on 8a71306: the arigl-web job, whose page is built from this branch, passed with the new case. ariglx-web failed it with no relay opens: that package is built without the WebSocket transport ("this build has no conference transport"), so the page never dials. Since c9b800d the harness runs the case only when the module's glue has the browser's WebSocket API (as cyprty's stage.sh checks), and says when it skips it.
  • ci.yml: the arigl-web job also runs when state_transport_ws changes.

Already checked live (2026-11-26, on the 4.0.9 deploy)

The relay side and arigl's rejoin re-assert, with the released 4.0.9 page against a local relay (grace 3 s, idle 4 s). After a relay restart, the fresh relay got the page's avatar colour back. A page frozen for 15 s was reaped, marked left and removed, and when it thawed it rejoined with its colour.

…ials again

reap_idle was a no-op in the browser (wasm) build of the WebSocket transport. A page whose relay,
or the path to it, went away without closing kept a link that would never speak again, so arigl
never dialed again; native clients and the relay already close such a link (#1483).

- In the browser, reap_idle closes and deletes a socket that has received nothing for the
  timeout (the relay pings every 2 s), so it is no longer a link, and arigl's net_step dials the
  relay again and re-asserts what it published. A backgrounded tab still answers the relay's
  Pings from onmessage, so it is not silent.
- It also deletes the socket of a link the browser closed (its onclose has fired) and sweeps the
  dead connections, which piled up over reconnects.
- arigl_web_smoke.mjs: a case with a fake relay on the test server (/apps/silent-relay) that sends
  one empty frame and then nothing. The page must log the close and dial a second time. Against
  arigl-web 4.0.9, without this change, the case fails (one open, no close) and the other 25 pass.
- ci.yml: the arigl-web job also runs when the WebSocket transport changes.
… WebSocket transport

ariglx-web is built without it (CVC_ENABLE_WS off), so CVC_ARIADNE_RELAY runs its document locally
and the page never dials: the case failed there with no relay opens. The harness now looks for the
browser's WebSocket API in the module's glue (arigl.js or ariglx.js), as cyprty's stage.sh does,
and says when it skips the case.
@transfix
transfix enabled auto-merge (squash) November 26, 2026 09:07
@transfix
transfix merged commit c7b050f into master Nov 26, 2026
29 of 31 checks passed
@transfix
transfix deleted the feat/browser-reap-idle branch November 26, 2026 12:50
transfix added a commit that referenced this pull request Nov 27, 2026
…ive live-labels volume that spans frames (#1556)

#1546 gated the case on the browser's WebSocket API in the module's glue. ariglx-web's threaded
(wasm-mt) ariglx.js has that API even though the package is built without the WebSocket transport,
so the case ran there, the page never dialed ("this build has no conference transport"), and the
job failed: on #1546's last head and on master since c7b050f. The single-threaded ariglx-web
job skipped it as meant. The case now runs only on arigl-web (arigl.js, no ariglx.js), the one
package with a conference transport.


Also: cvcgl_volume_grid_segment's cooperative live-labels check uses a 96^3 volume (was 56^3).
A cooperative run gets about 4 ms of work a frame, and on a fast package-linux runner the 56^3
run finished inside one frame's slice on all three tries, so no frame saw the labels so far.
transfix added a commit that referenced this pull request Nov 27, 2026
* chore: bump libcvc to 4.0.10

* arigl_web_smoke: run the silent-relay case on arigl-web alone; master's ariglx-web (wasm-mt) is red

#1546 gated the case on the browser's WebSocket API in the module's glue. ariglx-web's threaded
(wasm-mt) ariglx.js has that API even though the package is built without the WebSocket transport,
so the case ran there, the page never dialed ("this build has no conference transport"), and the
job failed: on #1546's last head and on master since c7b050f. The single-threaded ariglx-web
job skipped it as meant. The case now runs only on arigl-web (arigl.js, no ariglx.js), the one
package with a conference transport.

* tests: physics_field_test's Debug budget, and the tvision file pick's Enter

Two package-linux / libcvc-debug failures on PRs this week, neither in
their changes:

- PhysicsFieldWake.PackedBodiesStayBoundedAndSleep ran 1059 s in that
  lane on master (c7b050f) and timed out at 1200 s on #1552's and
  #1553's runs, three tries each. physics_field_test gets 2400 s.
- ari_run_file_pick_upload_tvision failed three tries on both: the Open
  file window showed the typed name but never took the Enter (tvision
  reads keys that come in one burst as a paste). Enter now goes once the
  field shows the name, and again, up to three times, while the window
  stays open.

* cvcgl_volume_grid_segment: a volume large enough that a cooperative run spans frames on any runner

The live-labels check needs a cooperative run (CVC_SLICED_THREADING=cooperative, about 4 ms of
work a frame) to span several frames, so some frame sees the labels so far. On a package-linux
runner (#1556's run, 2026-11-26) the 56^3 run finished inside one frame's slice
on all three tries: "labels so far shown while marching (56^3, cooperative): no". 96^3 is about
five times the work.

---------

Co-authored-by: Joe Rivera <[email protected]>
transfix added a commit that referenced this pull request Nov 28, 2026
build-wasm.sh builds arigl-web's conference transport single-threaded only
(libopus has no -pthread wasm build), so the wasm-mt package runs a
CVC_ARIADNE_RELAY document locally and the relay is never dialed. HAS_WS
read the glue, which a threaded build fills with the WebSocket API all the
same, so it ran #1546's case there. ci.yml never builds a threaded
arigl-web, so v4.0.10's publish-cvcgl-wasm was the first to try it: its
arigl-web (wasm-mt) leg failed "relay opens 0, closes 0" and that bundle
did not publish. A threaded package is served --isolated, so HAS_WS now
also needs !ISOLATED.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant