Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix spurious "Your server isn't responding to some requests" (#11306)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
t3chguy authored Jul 24, 2023
1 parent a70fcfd commit d268cc1
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/RoomNotifs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ function setRoomNotifsStateUnmuted(cli: MatrixClient, roomId: string, newState:
actions: [PushRuleActionName.DontNotify],
}),
);
// https://matrix.org/jira/browse/SPEC-400
promises.push(cli.setPushRuleEnabled("global", PushRuleKind.RoomSpecific, roomId, true));
} else if (newState === RoomNotifState.AllMessagesLoud) {
promises.push(
cli.addPushRule("global", PushRuleKind.RoomSpecific, roomId, {
Expand All @@ -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);
Expand Down

0 comments on commit d268cc1

Please sign in to comment.