Skip to content

Commit 00c90c1

Browse files
authored
Merge pull request #8006 from vector-im/feature/mna/push-rules-api-order
[Push rules] Call /actions api before /enabled api (PSG-1099)
2 parents cb093e0 + 18f1360 commit 00c90c1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

changelog.d/8005.sdk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[Push rules] Call /actions api before /enabled api

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/pushers/UpdatePushRuleActionsTask.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,22 @@ internal interface UpdatePushRuleActionsTask : Task<UpdatePushRuleActionsTask.Pa
3434

3535
internal class DefaultUpdatePushRuleActionsTask @Inject constructor(
3636
private val pushRulesApi: PushRulesApi,
37-
private val globalErrorReceiver: GlobalErrorReceiver
37+
private val globalErrorReceiver: GlobalErrorReceiver,
3838
) : UpdatePushRuleActionsTask {
3939

4040
override suspend fun execute(params: UpdatePushRuleActionsTask.Params) {
41+
if (params.actions != null) {
42+
val body = mapOf("actions" to params.actions.toJson())
43+
executeRequest(globalErrorReceiver) {
44+
pushRulesApi.updateRuleActions(params.kind.value, params.ruleId, body)
45+
}
46+
}
4147
executeRequest(globalErrorReceiver) {
4248
pushRulesApi.updateEnableRuleStatus(
4349
params.kind.value,
4450
params.ruleId,
4551
EnabledBody(params.enable)
4652
)
4753
}
48-
if (params.actions != null) {
49-
val body = mapOf("actions" to params.actions.toJson())
50-
executeRequest(globalErrorReceiver) {
51-
pushRulesApi.updateRuleActions(params.kind.value, params.ruleId, body)
52-
}
53-
}
5454
}
5555
}

0 commit comments

Comments
 (0)