mautrix / signal

A Matrix-Signal puppeting bridge
GNU Affero General Public License v3.0
484 stars 74 forks source link

Replies to relayed messages have the wrong user in `m.mentions` #517

Open pony1k opened 3 weeks ago

pony1k commented 3 weeks ago

Steps to repdroduce

  1. Have bridged room containing
    • a Matrix-only user (@bert:example.com)
    • a both Matrix and Signal user with relay enabled (@relay:example.com)
    • and a Signal-only user
  2. Matrix-only user writes a message
  3. Signal-only user replies to the relayed message
  4. Matrix-only user can not read the reply with element-android

Possible culprit Take a look at the decrypted source of the puppets reply:

{
  "content": {
    "body": "some reply",
    "m.mentions": {
      "user_ids": [
        "@relay:example.com"
      ]
    },
    "m.relates_to": {
      "m.in_reply_to": {
        "event_id": "$event_1"
      }
    },
    "msgtype": "m.text"
  },
  "event_id": "$event_2",
  "origin_server_ts": 1718028861367,
  "room_id": "!xyz:example.com",
  "sender": "@signal_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:example.com",
  "type": "m.room.message",
  "unsigned": {}
}

Notice that the user id in m.mentions is @relay:example.com, which is the relaying user, not the one that is actually responsible for $event_1, which normally would be the case. Maybe this is a problem for some clients.

Additional info It was also reported to me that element-android initially shows an error message, but I don't know yet what it sais. Also, users were able to read the reply message in a preview.

Version: 0.6.1+dev.860fad4d

tulir commented 3 weeks ago

Element Android doesn't support replies. However, bridged replies to relayed messages mentioning the wrong user seems like a real bug (it's not related to reply rendering in any way, just notifications)