Skip to content

feat(core): retire two more mesh-wide broadcast sites for directed room.notify - #141

Merged
Mearman merged 1 commit into
mainfrom
feat/directed-invite-notify
Sep 16, 2026
Merged

Mearman merged 1 commit into
mainfrom
feat/directed-invite-notify

Conversation

@Mearman

@Mearman Mearman commented Sep 16, 2026

Copy link
Copy Markdown
Member

Part of #48.

Continues the directed-delivery retirement started in the previous PR (deliverToRoom). Two more deliverLocallyAndBroadcast call sites in delivery-engine.ts swap the legacy mesh-wide broadcastPatch for a real, wire-authenticated directed room.notify, since both are addressed at exactly one agent, not a room's worth of members:

  • notifyRoomsOfNameChange's own trailing self-confirmation delivery. Traced every caller of updateAgent and confirmed this can genuinely target a remote agent (e.g. the web console's rename_agent action takes an arbitrary agent id from the directory, not just this store's own peer), so it needed a real directed send, not a local-only simplification. Addressed via the implicit DM path between this peer and the renamed agent.
  • emitDeliveryStatus, which reports a delivery receipt back to a message's sender -- who can obviously be remote. Now resolves the message's own room-path or DM-path via the already-existing findMessageLocation (previously only used by markRead) and sends the receipt directly to them.

Both fall back to plain local queueDelivery/fireLocalDelivery when the target is this store's own peer, matching deliverToRoom's own established self-case handling. deliverToRoom itself is refactored to share the new deliverToMember helper rather than duplicating its per-member body. findMessageSender is removed in favour of findMessageLocation, which already returns everything it did plus the room-path the directed send needs.

Remaining deliverLocallyAndBroadcast call sites (federation-bridge.ts's federated room-message fan-out, room-lifecycle.ts's post-join member-list delivery) are left for a follow-up PR -- each has its own distinct audience shape worth its own focused look rather than bundling everything into one change.

Test plan

  • New RED tests confirmed failing for the right reason before implementation
  • pnpm typecheck
  • pnpm lint
  • pnpm test (792/792)
  • pnpm build

…om.notify

notifyRoomsOfNameChange's own trailing self-confirmation delivery and
emitDeliveryStatus's delivery-receipt notification both used to ride
deliverLocallyAndBroadcast's legacy broadcastPatch, reaching every mesh peer
to inform one specific, possibly-remote agent. Both now resolve a real
room-path (the implicit DM path for a renamed agent, or the message's own
room/DM path for a delivery receipt) and send a directed, wire-authenticated
room.notify via the new deliverToMember helper, falling back to plain local
queueing when the target is this store's own peer.

deliverToRoom is refactored to share the same deliverToMember helper rather
than duplicating its per-member body.

findMessageSender is removed in favour of the already-existing
findMessageLocation, which also returns the room-path emitDeliveryStatus now
needs to address its directed send.
@Mearman
Mearman marked this pull request as ready for review September 16, 2026 04:21
@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-16T04:26:49.968472Z 5591439 Draft marked ready
ℹ️ 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 60b331c into main Sep 16, 2026
6 checks passed
@Mearman
Mearman deleted the feat/directed-invite-notify branch September 16, 2026 04:27
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.30.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