matrix-org / matrix-org/matrix-bifrost

Bridge will route direct-to-bridge messages as PMs to all room occupants

Open
#198 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

T-Defect
Dominant language
TypeScript
Stars
187
Forks
38
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

When you send a type=normal message to a bridged room's JID (e.g. after accidentally adding a room as a contact), the message will be forwarded to all room occupants.

To Reproduce
Steps to reproduce the behavior:

  1. Send a type=normal message to the room JID of a bridged room
  2. Everybody in the room will receive a PM with that message content
<message from="georg@yax.im/poezio-IS8H" to="#ietf-trial1-feedback#matrix.org@matrix.org" id="Yah0eegi">
  <body>This is a test. Please ignore.</body>
</message>

Expected behavior

The message is discarded by the room.

The bridge should only forward type=groupchat messages to everybody. Other message types sent to the bridge bare JID should be discarded. Messages sent to the occupant full JID of a user should be forwarded to that specific user.

Actual behavior

The message is forwarded to all the XMPP room occupants (maybe also to the Matrix ones?):

<message from="#ietf-trial1-feedback#matrix.org@matrix.org/Ge0rG" xml:lang="en"
    id="Yah0eegi" to="georg@yax.im/yaxim.E79AC025">
  <body>This is a test. Please ignore.</body>
</message>

<message from="#ietf-trial1-feedback#matrix.org@matrix.org/Ge0rG" xml:lang="en"
    id="Yah0eegi" to="georg@yax.im/poezio-IS8H">
  <body>This is a test. Please ignore.</body>
</message>

<message id="Yah0eegi" to="somebody@somebody.so/poezio-R-pE" xml:lang="en"
               from="#ietf-trial1-feedback#matrix.org@matrix.org/Ge0rG">
  <body>This is a test. Please ignore.</body>
</message>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the XML message flow for a type=normal message sent to a bridged room's bare JID, then trace how the bridge handles bare and occupant full JIDs. Compare that path with type=groupchat handling and verify that only groupchat messages reach all occupants, while direct messages to an occupant full JID still reach that user.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.