Skip to content

conference: remove departed participants after a per-room grace; rejoin, silent links, scene removals - #1483

Merged
transfix merged 2 commits into
masterfrom
feat/conference-leave-deletes
Nov 24, 2026
Merged

transfix merged 2 commits into
masterfrom
feat/conference-leave-deletes

Conversation

@transfix

@transfix transfix commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Builds on #1473 (deletes replicate), merged as 5949edc; rebased onto master.

A participant who left stayed in the room tree for good. The relay only marked it left (presence.joined=0), since a delete did not replicate before #1473. So every client held, and every join snapshot carried, a ghost of everyone who had ever joined. The conference roadmap's S7 notes called this out ("a join still grows with the soft-left ghosts' subtrees").

Two commits: the removal after a grace, then the gaps it left (a client back after the grace, a document that leaves but stays connected, silent connections, scene objects).

What changes

The relay removes departed participants (arisrv, room_departures, room_remove)

  • When a connection ends, the participant is marked left at once, as before: the roster, the holon and the area of interest drop it.
  • Once it has been away the grace without joining again, its subtree is removed from the room tree. That is one delete, which every client applies, and its tombstone buries anything the participant wrote before it.
  • One that joins again in time is kept, and finds what it published (its streams, avatar and device) still there: a reconnecting client keeps its pid. One whose connection is back but has not joined yet has the whole grace from then to do it.
  • A participant marked left that keeps its connection (a document's (room-leave), which closes nothing) is removed after the grace too.

The grace is per room

  • The server document's server: leave_grace_s: (whole seconds), which arisrv --leave-grace-s overrides; 300 when neither says. 0 removes a participant as its connection ends.

Back after the grace (room_own_state, room_reassert)

  • arigl keeps what it published under its node before it redials (its avatar choice, voice and video flags, a client program's keys), and writes it again while it rejoins. Left out: the relay's keys, its presence (re-joined anyway), its net readings (measured again), and its intent and drive request (the relay zeroes a departed participant's intent; neither may be sent twice). A leaf written anew since is left alone.
  • A document's (room-join) does the same after its own (room-leave).
  • The relay forgets the streams it relayed for a removed participant, so a stream published again is relayed afresh and marked ready again. Before, the relayed set was never cleared, so it would never be marked ready.

Silent connections (state_transport::reap_idle)

  • A peer gone without closing (a crash behind NAT, a suspended phone, a pulled cable) used to stay connected, so it never departed. The WebSocket transport had an idle reaper; the gRPC transport now has one too (a stream silent past the timeout is cancelled, as a close).
  • arisrv reaps both transports each second after --idle-timeout-s (default 10; 0 = never). Every link is probed each 2 s, so a live client is never that silent.
  • arigl and relay_session close a silent link to the relay too, so they dial again rather than wait for TCP to give up.

Scene objects, lights and avatar options the relay drops are removed from the tree (a delete each), not marked present = 0 (room_scene, room_avatar).

Bridged users leave with a delete at once (room_bridge_absent): the relay is their only writer, and one who comes back is written anew.

Why a grace, not a delete at once

arigl and relay_session reconnect under the same pid. If the relay deleted at once, a client back from a dropped link would have to write everything again, and the repeat of missed deletes on admit (#1473) would take it from the client's own tree too. With the grace, anyone back within 5 minutes is unaffected, and the room tree holds ghosts only of those who left in the last 5 minutes.

Not done

Tests

  • room_intrinsics_test:
    • RemoveTakesTheParticipantFromEveryNode: a relay-side remove is one delete, and it reaches the participant's own node, including what it published; a later join writes it anew.
    • RoomDepartures.OneAwayTheGraceIsRemoved, OneBackInTimeIsKept (joined again; connected again, with a new wait), OneThatLeftButStaysConnectedIsRemoved.
    • ARejoinWritesAgainWhatItPublished: two nodes; what is kept and what is left out, the relay's removal reaching the client, the rewrite reaching the relay, a newer write left alone.
    • RoomBridge.PresenceListsThemApartAndLeavingRemoves.
  • room_avatar_test: ARejoinAfterALeaveBringsTheChoiceBack (the verbs), and a dropped catalog option leaves the tree.
  • room_scene_test: a removed object, and one a new world drops, leave the tree.
  • state_transport_grpc_test: ReapIdleClosesASilentStreamAtEitherEnd, AQuietClientAnsweringPingsIsNotReaped.
  • ariadne_server_document_test: LeaveGraceTakesWholeSeconds.
  • Locally, on master after the rebase: these, plus room_chat, holon_sync, room_aoi, room_aoi_relay, client_registry, state_transport_ws and room_relay_integration (315 tests), and the 20 stock arisrv ctests. arigl's main.cpp compiled against this branch (WebSocket build); it is not run.
  • Live, arisrv with an ari test --relay client:
    • --leave-grace-s 2: "participant left", then "removed" 2.0 s later.
    • --doc with server: leave_grace_s: 2 and no flag: removed 2.8 s later.
    • --idle-timeout-s 4, the client frozen (a debugger attached, so its socket stays open): "[grpc] reaping idle connection ... idle=4.6s", "participant left", then "removed".

@transfix transfix changed the title conference: remove a departed participant from the room tree after a grace conference: remove departed participants after a per-room grace; rejoin, silent links, scene removals Nov 23, 2026
Base automatically changed from feat/state-delete-replication to master November 23, 2026 14:49
…grace

A participant who left stayed in the room tree for good. The relay only marked it left
(presence.joined=0), since a delete did not replicate before #1473. So every
client held, and every join snapshot carried, a ghost of everyone who had ever joined.

The relay (arisrv) now removes them:
- When a connection ends, the participant is marked left at once, as before: the roster, the
  holon and the area of interest drop it.
- Once it has been away --leave-grace-s (default 300) without coming back, room_departures
  removes its subtree (room_remove): one delete, which every client applies.
- One back in time, joined again or holding a connection, is kept. A client that reconnects
  (it keeps its pid) finds what it published, its streams, avatar and device, still there.
- --leave-grace-s 0 removes it as its connection ends.

A bridged user leaves with a delete at once (room_bridge_absent). The relay is their only writer,
and one who comes back is written anew.

room_leave still only marks a participant left: a client's (room-leave) and a document's
teardown do that, and the relay removes it once its connection has gone.

Docs: the conference roadmap's switch table, reaping note and room-leave row;
DISTRIBUTED_STATE_ROADMAP.md's known gaps.
…links, scene removals

The first commit removes a departed participant after a grace. This one fills what it left open.

- The grace is per room: the server document's server: leave_grace_s: (whole seconds), which
  --leave-grace-s overrides; 300 when neither says.
- A participant marked left that keeps its connection (a document's (room-leave)) is removed
  after the grace too: room_departures::reap finds it. One whose connection is back after a
  drop has the whole grace from then to join again, and is removed if it never does.
- Back after the grace: room_own_state keeps what a participant published under its node (not
  the relay's keys, its presence, intent, net readings or drive request), and room_reassert
  writes it again. arigl takes it before it redials and writes it while it rejoins; a
  document's (room-join) does it after its own (room-leave). The relay forgets the streams it
  relayed for a removed participant, so one published again is relayed and marked ready afresh.
- Silent connections: state_transport::reap_idle, now on the gRPC transport too (a stream
  silent past the timeout is cancelled, as a close). arisrv reaps both transports each second
  after --idle-timeout-s (default 10; 0 = never), and arigl and relay_session close a silent
  link to the relay, so they dial again.
- Scene objects, lights and avatar options the relay drops are removed (a delete each), not
  marked present = 0.

Docs: ARIADNE.md's server: block, the conference roadmap's switches and reaping note, and
DISTRIBUTED_STATE_ROADMAP.md's known gaps.
@transfix
transfix force-pushed the feat/conference-leave-deletes branch from a061e0c to 7c68514 Compare November 24, 2026 02:22
@transfix
transfix merged commit 1dc962a into master Nov 24, 2026
28 of 32 checks passed
@transfix
transfix deleted the feat/conference-leave-deletes branch November 24, 2026 09:37
transfix added a commit that referenced this pull request Nov 24, 2026
# Conflicts:
#	src/cvc/CMakeLists.txt
transfix added a commit that referenced this pull request Nov 24, 2026
… = 0 (#1525)

write_room_entities marked an entity the world no longer has present = 0, so the room tree, and
every client's copy and join snapshot, kept a subtree for every entity that ever ran. Deletes
replicate since #1473, and the room's scene objects, lights and avatar options are
removed that way since #1483; entities now are too.

- section_writer::remove takes an entry (a leaf or a subtree) out of a revisioned section: one
  delete, which every peer applies, and whose tombstone keeps a peer that still holds the entry
  from bringing it back. Never the section itself.
- write_room_entities removes each entity the section has that the world does not, before the
  commit that bumps the revision, so a reader that sees the new revision no longer finds it.
  Readers still take only entries with present = 1, which a write sets last.

Docs: room_entities.h, the conference roadmap's reaping note, ARIADNE_WORLDS.md's scene wire
format and old-relay note.
transfix added a commit that referenced this pull request Nov 26, 2026
…ials again (#1546)

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.

- The smoke case runs only on a package with the WebSocket transport (the browser's WebSocket
  API in the module's glue, as cyprty's stage.sh checks): ariglx-web is built without it, so its
  page never dials a relay, and the harness says when it skips the case.
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