Resolve reaction/reply targets across all XMPP message ID forms #3
Loading…
Reference in a new issue
No description provided.
Delete branch "reaction-id-aliases"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Reactions (XEP-0444), replies (XEP-0461), edits (XEP-0308), retractions (XEP-0424) and read markers (XEP-0333) from XMPP clients were still dropped with
Target message for reaction not foundeven after #1.Root cause: the bridge stores each message under exactly one ID form (
oid:<origin-id>/id:<id attribute>/sid:<stanza-id>), while remote clients reference whichever form they saw — usually the room-distributedidattribute, sometimes a stanza-id. When those differ, the lookup finds nothing and the event is queued with aprefixedFallbackID that can never match.Fix
roomIDCache+ durablekv_store(xmpp/roomid/<room>/<raw>).resolveMessageIDconsults the volatile cache, then the durable aliases, then the DB forms.MessageMetadata.RoomIDis now set at convert time for MUC messages (the distributed id attribute) and backfilled into the DB row when our own MUC reflections arrive;rawIDForOutgoingReference(replies, reactions, edits, retractions, read receipts from Matrix) prefers it, then the reverse alias (xmpp/roomraw/<room>/<stored>), then the stored value — so references bridged from Matrix use the form other XMPP clients actually see.Also updates AGENTS.md with the alias architecture and adds tests for alias recording/resolution, outgoing reference selection and MUC metadata.
Testing
go build ./...,go vet ./...,go test ./...pass (new tests inreactions_test.go).Target message for reaction not foundwarnings; the same must work for messages fetched by MAM backfill.