Commit 44111a2
authored
Add some tests for push rule behavior on room upgrade (#819)
In Synapse, this behavior is handled by [`transfer_room_state_on_room_upgrade`](https://github.com/element-hq/synapse/blob/322481cd2d694eb5fe6107f3c0cd8d48252439bc/synapse/handlers/room_member.py#L1344-L1348) -> `copy_user_state_on_room_upgrade` ->
[`copy_push_rules_from_room_to_room_for_user`](https://github.com/element-hq/synapse/blob/322481cd2d694eb5fe6107f3c0cd8d48252439bc/synapse/storage/databases/main/push_rule.py#L943-L947).
In Dendrite, this behavior is handled by [`handleRoomUpgrade`](https://github.com/element-hq/dendrite/blob/fbbdf84ac62699ee952e091b4a8cc9577bd4f6bb/userapi/consumers/roomserver.go#L209-L227) -> [`copyPushrules`](https://github.com/element-hq/dendrite/blob/fbbdf84ac62699ee952e091b4a8cc9577bd4f6bb/userapi/consumers/roomserver.go#L229-L254).
This behavior is not explained in the [Matrix spec](https://spec.matrix.org/v1.16/client-server-api/#server-behaviour-19) but perhaps that just needs a clarification/MSC to document the state of things. Synapse and Dendrite do this for example.
---
This is spawning from wanting to see whether I can reproduce an issue I was experiencing during the recent room upgrades to v12. I previously had my notification settings for a room as "Mentions & keywords" in Element Web but then after the upgrade, it was using the "Match default settings" and I was receiving notifications for all new messages. The tests do now reproduce the problem!
See element-hq/synapse#191991 parent f67a50e commit 44111a2
2 files changed
+422
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
177 | 202 | | |
178 | 203 | | |
179 | 204 | | |
| |||
214 | 239 | | |
215 | 240 | | |
216 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
217 | 257 | | |
218 | 258 | | |
219 | 259 | | |
| |||
0 commit comments