Repository navigation
The room bridge: NMDC users in the conference room, the chats joined - #17
Merged
Merged
Conversation
server/src/sublevels/bridge.py joins the NMDC hub to the relay's room through arisrvx's bridged-users API (transfix/libcvc#1302, 4.0.2): every online NMDC user is a bridged user of the room (via nmdc, with their client and share as the detail), so Ariadne clients list them in the room's users; NMDC main chat goes to the room's chat (unescaped, not hub commands), and a participant's room post reaches NMDC users as <[room]name> text. Direct messages go both ways: a participant's DM arrives as a $To from [room]name, and an NMDC user's reply to [room]name goes back to that participant. Hub nicks may not take the [room] prefix (P3 section 5). A host without the API runs without the bridge and says so. Tests: the bridge against a stand-in host (any pycvc), and through libcvc's ServerHarness(room=) when pycvc.ariadne has it (skipped on 4.0.0/4.0.1; SUBLEVELS_REQUIRE_BRIDGE=1 requires it). All 118 pass with #1302's pycvc.ariadne.
…smoke run checks the bridge starts server/ci/install.sh pins libcvc 4.0.2+cvc.2 with arisrvx and pycvc-cp312 4.0.2+cvc.1, the first release with the bridged-users API; ci.yml sets SUBLEVELS_REQUIRE_BRIDGE; the arisrvx smoke run checks that the bridge starts and that both NMDC users joined the room; the recipe and the server document ask for 4.0.2.
Contributor
Author
|
libcvc 4.0.2 is now on cvcpkg. e48e681 moves CI to it:
CI run 44697058853 is green: the arisrvx job passed 118 tests with none skipped. Still to do: an Ariadne client that joins the room and chats with an NMDC user in the smoke run. That needs arigl 4.0.2 (or another host with the 4.0.2 room verbs) on cvcpkg; only arigl 4.0.1 is published so far. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Joe asked that NMDC users end up in a known conference room, where Ariadne clients see them and chat with them over the room chat. This builds that on arisrvx's bridged-users API (transfix/libcvc#1302, merged, in the v4.0.2 tag). It uses libcvc's documented host API only; no DC implementation was opened.
What it does (
server/src/sublevels/bridge.py)--room, by defaultstandup, whichsublevelssets as cyprty does. Under plain python it isSUBLEVELS_ROOM.host.room_presence(..., via="nmdc")). Ariadne clients list them in the room's users with the detail"<client>, <share> shared";$MyINFOupdates refresh that detail. When a user leaves the hub,room_absenttakes them out.room_chat_post), with the text unescaped as P3 §5 says. Hub commands such as+helpstay on the hub.on_room_chat) reaches every NMDC user as<[room]name> text|, escaped.on_room_dm) arrives as$To: <nick> From: [room]name …. The NMDC user's reply to[room]namegoes back to that participant as a room DM.[room]name, nick-safe, and the hub refuses any nick with that prefix, so they can't be confused with hub users (P3 §5's "prefix that marks them as bridged").Tests
tests/test_bridge.pyruns against a stand-in host, so it works with any pycvc or none. It covers:tests/test_bridge_harness.pyruns through libcvc'sServerHarness(room=): an Ariadne participant sees an NMDC user in its roster, the two chat both ways, the DMs go both ways, and the user leaves the roster.SUBLEVELS_REQUIRE_BRIDGE=1turns the skip into a failure.pycvc.ariadneloaded over pycvc 4.0.0 and the harness and the bridge both required.Follow-ups
server/ci/install.shto 4.0.2 and setSUBLEVELS_REQUIRE_BRIDGE: '1'in ci.yml;[room]namein main chat and in private messages, and reserves that prefix for hub nicks.