Skip to content

feat(core): wire sendRoomMessage's opt-in durable-recording flag - #137

Merged
Mearman merged 1 commit into
mainfrom
feat/room-notice-catchup
Sep 16, 2026
Merged

Mearman merged 1 commit into
mainfrom
feat/room-notice-catchup

Conversation

@Mearman

@Mearman Mearman commented Sep 16, 2026

Copy link
Copy Markdown
Member

Adds an optional durable parameter to sendRoomMessage; when true, it also records the message as a room-notice in the sender's own oplog via recordRoomSendNotice (#135), alongside the existing wire-authenticated fan-out. Deliberately opt-in per call, not automatic -- a caller decides per message whether it should be catch-up-able.

MeshStoreIdentity gains a dataStorage field (a KeyValueStorage instance) -- the same one WireMeshTransport's own frame responder (#136) reads and writes, so a durable send and a peer's later data-request against this device's log operate on one shared oplog, not two independent ones. bridge-mesh.ts constructs it once via createNodeFsStorage(oplogDirFor(slot)) and wires it to both the transport and the store's own identity.

This closes out the two pieces #50's own tracking called "genuinely open" after #136 -- the opt-in send-path mechanism is now real, and the storage-construction half of the catch-up policy (where MeshStore's own KeyValueStorage instance actually lives) is wired end to end. What's still deliberately not built: proactively calling sendDataFrame with an initial data-have after a durable append, and deciding which peers' logs to track for catch-up -- genuine per-deployment policy choices, not mechanical wiring, and each is small enough to add later without touching anything landed here.

Tested with real identities and a real minted token throughout (recordRoomSendNotice genuinely mints and signs, so an opaque placeholder token fails outright) -- the durable-send test decodes the stored bytes back out and runs them through a real verifyRoomNotice, not just checking the append succeeded.

Refs #50.

sendRoomMessage gains an optional durable parameter; when true, it
also records the message as a room-notice in the sender's own oplog
via recordRoomSendNotice (#135), alongside the existing wire-
authenticated fan-out. Deliberately opt-in per call, not automatic --
a caller decides per message whether it should be catch-up-able,
matching this codebase's own established design for the mechanism.

MeshStoreIdentity gains a dataStorage field (a KeyValueStorage
instance), the same one WireMeshTransport's own frame responder
(#136) reads and writes, so a durable send and a peer's later
data-request against this device's log operate on one shared oplog.
bridge-mesh.ts constructs it once via createNodeFsStorage(oplogDirFor(slot))
and wires it to both the transport and the store's own identity.

Every existing fake MeshStoreIdentity fixture across the test suite
needed the new required field added -- an opaque placeholder for the
many tests that never exercise durable sends, a real in-memory
KeyValueStorage for the ones (room-messaging-durable-send.test.ts,
test-transport.ts's shared harness) that do.
@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-16T03:09:44.136888Z 6193f17 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 a93ecff into main Sep 16, 2026
6 checks passed
@Mearman
Mearman deleted the feat/room-notice-catchup branch September 16, 2026 03:10
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.26.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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