Skip to content

feat(core): wire this store's own rooms into the hosted-rooms gossip - #132

Merged
Mearman merged 1 commit into
mainfrom
feat/hosted-rooms-wiring
Sep 16, 2026
Merged

Mearman merged 1 commit into
mainfrom
feat/hosted-rooms-wiring

Conversation

@Mearman

@Mearman Mearman commented Sep 16, 2026

Copy link
Copy Markdown
Member

Adds MeshStore.hostedRooms, reading this store's own currently-owned public/private rooms out of the existing rooms Map in the lightweight gossip-safe shape #131's readvertiseGossip tick expects (secret rooms and merely-replicated-not-owned rooms excluded). bridge-mesh.ts wires it in as WireMeshTransport's getHostedRooms callback, the same construction site selfStatus already feeds getCurrentPresence through.

This is the remaining wiring piece #48 flagged after #130/#131 landed: the gossip mechanism now actually carries real room data end to end, not just a synthetic test fixture. createRoom's own room_upsert broadcast is untouched -- this makes the gossip-based picture available alongside it, not a replacement. Merging a gossip-discovered room into listRooms (for a peer that hasn't joined yet) is still its own separate follow-up, per #48's own note that it needs a real decision about a not-yet-joined room's synthesized shape.

Refs #48.

MeshStore gains a hostedRooms getter, reading this store's own
currently-owned public/private rooms out of the existing rooms Map
in the lightweight gossip-safe shape WireMeshTransport's own
readvertiseGossip tick expects. Secret rooms and rooms this store has
only replicated (rather than owns) are excluded -- "hosted" means
this device is the one a joiner should actually reach.

bridge-mesh.ts wires it in as WireMeshTransport's getHostedRooms
callback, the same construction site selfStatus already feeds
getCurrentPresence through. createRoom's own room_upsert broadcast
stays untouched -- this only makes the gossip-based picture available
alongside it, not a replacement yet.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-16T01:35:06.769950Z b79d104 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit d592f4a into main Sep 16, 2026
6 checks passed
@Mearman
Mearman deleted the feat/hosted-rooms-wiring branch September 16, 2026 01:35
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.24.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Mearman added a commit that referenced this pull request Sep 16, 2026
listRooms now also surfaces every public/private room this store has
heard gossiped by another device (via room/hosted, #131/#132) but
never joined or otherwise locally recorded, mixed into its existing
Room[] result as a display-only placeholder -- id/name/type/owner/
description real, everything membership-shaped (members, memberJoins,
etc.) genuinely empty, since a gossip hint is not the same as
admission and this store has nothing else real to report for it. A
room already known locally always wins; a gossip advert for it is
silently ignored rather than shadowing the real record.

MeshTransport gains an optional listKnownDevices method (matching
WireMeshTransport's own already-shipped implementation) so
RoomLifecycle can read it through the existing abstract requireTransport()
port rather than depending on the concrete WireMeshTransport type --
absent for any transport implementation that doesn't offer it, in
which case the merge step is simply a no-op, matching every
construction site that predates this feature.

A gossiped candidate is narrowed through a real type guard
(isHostedRoomAdvert) before use, matching the codebase's own
"an advert not participating in this convention is not an error"
gossip-consumption pattern already established for presence/status.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant