Skip to content

Conversation

@jason-famedly
Copy link
Collaborator

No description provided.

MadLittleMods and others added 5 commits November 18, 2025 16:32
Spawning from wanting to give an accurate reply on element-hq/synapse#19153

But this is just general missing test coverage that's good to have.

There are many more scenarios to test here but Synapse doesn't behave well so it's tough to introduce something that will just fail. Something for the future ⏩
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#19199
Per the spec, keep paginating `/messages` until no `end` token.

> Note that an empty `chunk` does not *necessarily* imply that no more events are available. Clients should continue to paginate until no `end` property is returned.
>
> *-- https://spec.matrix.org/v1.16/client-server-api/#get_matrixclientv3roomsroomidmessages*
@jason-famedly jason-famedly merged commit 9177f81 into main Jan 14, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants