Fix topic diffing from original creation

This commit is contained in:
Cadence Ember
2025-12-16 12:17:34 +13:00
parent e4d0838af5
commit 231b26113e
2 changed files with 37 additions and 21 deletions
+8
View File
@@ -109,6 +109,14 @@ function diffKState(actual, target) {
} else if (key === "m.room.create/") {
// can't be modified - only for kstateToCreationContent
} else if (key === "m.room.topic/") {
// synapse generates different m.room.topic events on original creation
// https://github.com/element-hq/synapse/blob/0f2b29511fd88d1dc2278f41fd6e4e2f2989fcb7/synapse/handlers/room.py#L1729
// diff the `topic` to determine change
if (!(key in actual) || actual[key].topic !== target[key].topic) {
diff[key] = target[key]
}
} else if (key in actual) {
// diff
if (!isDeepStrictEqual(actual[key], target[key])) {