Skip to content

feat(core): gossip this side's own currently-hosted public/private rooms - #131

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

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

Conversation

@Mearman

@Mearman Mearman commented Sep 16, 2026

Copy link
Copy Markdown
Member

Generalises WireMeshTransport's presence-only gossip tick (readvertisePresence) into readvertiseGossip, which now also carries an optional room/hosted extension listing this side's own currently-advertised public/private rooms, sourced from a new getHostedRooms constructor callback (the same pull-not-push shape getCurrentPresence already established). Both facts ride the same gossip frame per tick rather than a separate frame each.

This is the write half of the room-discovery replacement #48's own P3.8 investigation scoped out: listKnownDevices() (#130, merged) can now read another device's hosted-rooms advert directly under room/hosted, the same way it already reads presence/status, with no bespoke per-fact transport event needed.

Deliberately not wired into listRooms in this PR -- merging a gossip-discovered room into the existing local rooms map needs its own decision about what a not-yet-joined room's synthesized shape should look like (a full Room object has membership/grant fields a gossip hint doesn't carry), so that stays its own follow-up per #48's established pattern of giving each piece its own design pass.

Refs #48.

WireMeshTransport's periodic gossip tick (previously presence-only)
now also carries an optional room/hosted extension listing this
side's own currently-advertised public/private rooms, generalising
the presence-readvertise mechanism into readvertiseGossip so both
facts ride the same gossip frame per tick rather than a separate
frame each.

This is the write half of P3.8's room-discovery replacement for
createRoom's own broadcastPatch: a peer's listKnownDevices() can now
read another device's hosted-rooms advert directly, the same way it
already reads presence/status, with no bespoke per-fact transport
event needed. Merging a gossip-discovered room into listRooms is
deliberately left for its own follow-up, since it needs to decide
what a not-yet-joined room's synthesized shape should look like.
@chatgpt-codex-connector

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:20:44.921711Z 6a22eaa 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 76dbc44 into main Sep 16, 2026
6 checks passed
@Mearman
Mearman deleted the feat/hosted-rooms-gossip branch September 16, 2026 01:21
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant