Repository navigation
Conversation
Mini-apps could send messages but never fix one, so any live-card /
coordination app had to spam corrections as new messages. The composer
already edits via m.replace internally; this exposes the same semantics
as a mini-app service:
- miniapp-core: EditMessage{event_id, body} variant, parse arm
(room-attached, trimmed non-empty body, 4096-char cap like reply),
priced 8.0 with the other send services. Parse tests cover the accept
path, both missing-arg errors, the length cap and roomless refusal.
- host: dispatch to a new send::edit() which loads the original event,
refuses up front when it isn't the user's own message (a forged
m.replace would be silently dropped by every client — answer honestly
instead), keeps the original mentions so the edit doesn't re-ping, and
goes through the same sensitive-target review + audit gates as sends.
- The wire shape (fallback '* ' body, m.new_content, m.relates_to) is
pinned by unit tests against what the room timeline renderer matches.
Closes hagency-org#90
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.
What
Adds the
matrix.edit_messageservice (m.replace) to the mini-app surface, closing #90.Mini-apps could send messages but never fix one — any live-card / coordination app (polls, tally boards, status cards) had to post corrections as new messages. The composer already edits via
m.replaceinternally; this exposes the same semantics as a service:MatrixServiceCall::EditMessage { event_id, body }, aparsearm (room-attached; trimmed non-empty body; same 4096-char cap asmatrix.reply), priced 8.0 with the other send services. Capability gating needs no whitelist change: the manifest namesmatrix.edit_messageand the call-time check inminiapps/package.rsmatches by service string.send::edit(), which loads the original event (cache first, explicit audited fetch fallback — same helper asmatrix.event) and refuses up front when it isn't the user's own message. A forgedm.replaceis silently dropped by every client, so answering an error here is the honest behavior. The original's mentions are handed tomake_replacementso the edit doesn't re-ping. The send goes through the samecommit_sensitive_targetreview +audit_room_operationgates assend_message.{}on success, matchingmatrix.send_message.Verification
Not done: a live end-to-end run against a real homeserver (needs the full GUI + logged-in session). The new external surface is one
room.send()of a ruma-constructedm.replace— the same call shape as the existing send path — and the issue already records palpo'sm.replacesemantics (acknowledged without/relationsaggregation). Happy to add a scripted live check if you'd like one before merge.Found while building a GOSIM Agentic App Hackathon 2026 entry (a group-coordination mini-app that wanted to update its tally card in place).