feat(core): retire two more mesh-wide broadcast sites for directed room.notify - #141
Merged
Merged
Conversation
…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
marked this pull request as ready for review
September 16, 2026 04:21
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🎉 This PR is included in version 2.30.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Part of #48.
Continues the directed-delivery retirement started in the previous PR (
deliverToRoom). Two moredeliverLocallyAndBroadcastcall sites indelivery-engine.tsswap the legacy mesh-widebroadcastPatchfor a real, wire-authenticated directedroom.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 ofupdateAgentand confirmed this can genuinely target a remote agent (e.g. the web console'srename_agentaction 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-existingfindMessageLocation(previously only used bymarkRead) and sends the receipt directly to them.Both fall back to plain local
queueDelivery/fireLocalDeliverywhen the target is this store's own peer, matchingdeliverToRoom's own established self-case handling.deliverToRoomitself is refactored to share the newdeliverToMemberhelper rather than duplicating its per-member body.findMessageSenderis removed in favour offindMessageLocation, which already returns everything it did plus the room-path the directed send needs.Remaining
deliverLocallyAndBroadcastcall 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
pnpm typecheckpnpm lintpnpm test(792/792)pnpm build