Fix spurious "Your server isn't responding to some requests" (#11306)

When changing room notification settings
This happened due to a race condition between adding a push rule and enabling it, the latter being superfluous given the spec says

> When creating push rules, they MUST be enabled by default.
This commit is contained in:
Michael Telatynski 2023-07-24 18:29:04 +01:00 committed by GitHub
parent a70fcfd0bc
commit d268cc1b75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -152,8 +152,6 @@ function setRoomNotifsStateUnmuted(cli: MatrixClient, roomId: string, newState:
actions: [PushRuleActionName.DontNotify], actions: [PushRuleActionName.DontNotify],
}), }),
); );
// https://matrix.org/jira/browse/SPEC-400
promises.push(cli.setPushRuleEnabled("global", PushRuleKind.RoomSpecific, roomId, true));
} else if (newState === RoomNotifState.AllMessagesLoud) { } else if (newState === RoomNotifState.AllMessagesLoud) {
promises.push( promises.push(
cli.addPushRule("global", PushRuleKind.RoomSpecific, roomId, { cli.addPushRule("global", PushRuleKind.RoomSpecific, roomId, {
@ -166,8 +164,6 @@ function setRoomNotifsStateUnmuted(cli: MatrixClient, roomId: string, newState:
], ],
}), }),
); );
// https://matrix.org/jira/browse/SPEC-400
promises.push(cli.setPushRuleEnabled("global", PushRuleKind.RoomSpecific, roomId, true));
} }
return Promise.all(promises); return Promise.all(promises);