element-hq / element-web

A glossy Matrix collaboration client for the web.
https://element.io
GNU Affero General Public License v3.0
11.18k stars 2k forks source link

Mentioned by reply to message that mentioned me #27291

Open Kladki opened 7 months ago

Kladki commented 7 months ago

Steps to reproduce

  1. Send a message that mentions a user
  2. Reply to that message
  3. Reply to the previous reply
  4. Reply to the previous reply

and so on...

Outcome

What did you expect?

I expected I would only be mentioned by the message that actually mentioned me, as I do not want to be constantly mentioned in messages that may have nothing to do with me It also isn't clear why I am mentioned in this case, because there is no visible indicator of my name or anything by the second reply, and it seems that many don't expect/are unaware of this behavior.

What happened instead?

I am mentioned by all messages that recursively reply to a message that mentions me.

You can see in the raw json in all recursive messages I am mentioned intentionally:

{
  "content": {
    "body": "> <@root:conduit-test-server.ahouansou.cz> hi\n\nhi",
    "format": "org.matrix.custom.html",
    "formatted_body": "<mx-reply><blockquote><a href=\"https://matrix.to/#/!kzWXGdAbtsmxSbwkNg:synapse-test-server.ahouansou.cz/$gmY2TB1LRa0D4b2muCtW51D5fl--Noxh_TE8ltJ6J18?via=ahouansou.cz&via=conduit-test-server.ahouansou.cz&via=synapse-test-server.ahouansou.cz\">In reply to</a> <a href=\"https://matrix.to/#/@root:conduit-test-server.ahouansou.cz\">@root:conduit-test-server.ahouansou.cz</a><br>hi</blockquote></mx-reply>hi",
    "m.mentions": {
      "user_ids": [
        "@matthias:ahouansou.cz"
      ]
    },
    "m.relates_to": {
      "m.in_reply_to": {
        "event_id": "$gmY2TB1LRa0D4b2muCtW51D5fl--Noxh_TE8ltJ6J18"
      }
    },
    "msgtype": "m.text"
  },
  "event_id": "$xVaz4XYilJOGx9yFcR0KJrM0Q_4_vjv1wMUMUHVo7g8",
  "origin_server_ts": 1712509186956,
  "sender": "@root:conduit-test-server.ahouansou.cz",
  "type": "m.room.message",
  "unsigned": {
    "age": 1
  },
  "room_id": "!kzWXGdAbtsmxSbwkNg:synapse-test-server.ahouansou.cz"
}

Operating system

Alpine Linux Edge

Application version

Element version: 1.11.63 Crypto version: Rust SDK 0.7.0 (b1918e9), Vodozemac 0.5.1

How did you install the app?

Alpine linux package manger (apk): https://pkgs.alpinelinux.org/packages?name=element-desktop

Homeserver

Conduit 0.7.0-alpha (2c73c3ad)

Will you send logs?

No

t3chguy commented 7 months ago

Sounds like your server doesn't support m.mentions push rules. This isn't something the client can work around as both client & server apply the same push rules.

Kladki commented 7 months ago

In the event json that I posted of the third recursive reply, you can see that my user is is still in the event, hence meaning it will mention me, and is not due to server fault.

8 Apr 2024 08:39:25 Michael Telatynski @.***>:

Sounds like your server doesn't support m.mentions push rules. This isn't something the client can work around as both client & server apply the same push rules.

— Reply to this email directly, view it on GitHub[https://github.com/element-hq/element-web/issues/27291#issuecomment-2042064390], or unsubscribe[https://github.com/notifications/unsubscribe-auth/BFX23U25TOR4W36VMUL4P23Y4JCSZAVCNFSM6AAAAABF3PCS6WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBSGA3DIMZZGA]. You are receiving this because you authored the thread. [Tracking image][https://github.com/notifications/beacon/BFX23U6YJHRTFITDNBMQD73Y4JCSZA5CNFSM6AAAAABF3PCS6WWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTZW5XAM.gif] Message ID: @.***>

t3chguy commented 7 months ago

I am presuming you are @root:conduit-test-server.ahouansou.cz - you did not specify which MXID is yours.

Once Intentional Mentions is supported by both the Client & Server (it is supported by Element Web & Desktop already) then the m.mentions field takes over and your MXID is not simply grepped out of the body. The way the check is done is defined by the spec (push rules) and the client must implement it like that otherwise the notifications will work differently for encrypted & unencrypted rooms and the client would be spec-incompliant. Once your server supports Intentional Mentions it'll fix cases like this.

image

Related https://github.com/element-hq/element-meta/issues/2067 Related https://github.com/element-hq/element-meta/issues/1623 Related https://github.com/element-hq/element-meta/issues/886

Kladki commented 7 months ago

Sorry, my bad. I (the user being unintentionally mentioned) am @matthias:ahouansou.cz. @root:conduit-test-server.ahouansou.cz is the user replying to a reply of a reply of a reply of a message that mentions me.

I am using element desktop, root is on element web (Element version: 1.11.63 Crypto version: Rust SDK 0.7.0 (b1918e9), Vodozemac 0.5.1)

t3chguy commented 7 months ago

Sounds like the sender's @root:conduit-test-server.ahouansou.cz client intentionally mentioned you then, given you are listed in the m.mentions. You'd need them to open an issue with whatever client project they are using and include logs.

Kladki commented 7 months ago

Sorry, I edited the message above and added that root is using element web, (Element version: 1.11.63 Crypto version: Rust SDK 0.7.0 (b1918e9), Vodozemac 0.5.1). I will go get logs.

Kladki commented 7 months ago

Logs have been sent, can we please re-open this issue since the client being used was element web?

tulir commented 5 months ago

Made a MSC and PR to fix the silly recommendation in the spec: matrix-org/matrix-spec-proposals#4142 / matrix-org/matrix-react-sdk#12511

dbkr commented 1 month ago

Product folk: does this match your idea of how element should work? ie. I mention Bob in a message, someone else replies to that message, should Bob's client go ping again? We have a community PR ready to fix this.