matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.83k stars 2.13k forks source link

Incorrect notications from intentional mentions which include @room? #16460

Open clokep opened 1 year ago

clokep commented 1 year ago

Support for intentional mentions was apparently stabilized in https://github.com/matrix-org/synapse/pull/15520 / Synapse v1.86.0rc1, right? Yet, when I just sent a message with @room in a code block, which Element Web correctly translated to m.mentions being set but without the room flag, people still got notified.

The spec says that the push rule for @room should only be enabled if the event does not have an m.mentions property.

Originally posted by @jplatte in https://github.com/matrix-org/synapse/issues/15661#issuecomment-1752915731

clokep commented 1 year ago

Looking at the code it doesn't seem like Synapse would generate this notification:

https://github.com/matrix-org/synapse/blob/5946074d69314226343a0727f24e3aa9616aa1f6/rust/src/push/evaluator.rs#L170-L178

Are the people getting notified on updated clients that understand intentional mentions? Is the notification coming from the server or from the client?

jplatte commented 1 year ago

Thanks. I really just wrote that comment to get a quick "this should work - probably an EleWeb issue" or "oh yeah we didn't actually implement that part of the spec yet". Based on what you wrote above it's the former.

clokep commented 1 year ago

My guess would be either:

  1. Someone is running an old Element Web (or other client that doesn't implement the new rules);
  2. A bug in a client

It definitely could be a bug in Synapse, but we do also test this behavior:

https://github.com/matrix-org/synapse/blob/9ec3da06daf70b5e799545a6e12ead4846559d80/tests/push/test_bulk_push_rule_evaluator.py#L372-L382