From e74ec97ec0062d8c9ed43a0ecb3d69d0aa79b130 Mon Sep 17 00:00:00 2001 From: Jorge Martin Espinosa Date: Wed, 15 Oct 2025 14:07:18 +0200 Subject: [PATCH] Fix 'test push loop back' notification check (#5541) Include a fake client secret as the HS would do, since it's now mandatory. --- .../push/impl/pushgateway/PushGatewayDevice.kt | 11 ++++++++++- .../push/impl/pushgateway/PushGatewayNotification.kt | 2 +- .../push/impl/pushgateway/PushGatewayNotifyRequest.kt | 7 +++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayDevice.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayDevice.kt index 47ebc2754b..c712a2d24b 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayDevice.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayDevice.kt @@ -21,5 +21,14 @@ data class PushGatewayDevice( * Required. The pushkey given when the pusher was created. */ @SerialName("pushkey") - val pushKey: String + val pushKey: String, + /** Optional. Additional pusher data. */ + @SerialName("data") + val data: PusherData? = null, +) + +@Serializable +data class PusherData( + @SerialName("default_payload") + val defaultPayload: Map, ) diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayNotification.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayNotification.kt index ebbc305a75..0305ebad8b 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayNotification.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayNotification.kt @@ -20,5 +20,5 @@ data class PushGatewayNotification( * Required. This is an array of devices that the notification should be sent to. */ @SerialName("devices") - val devices: List + val devices: List, ) diff --git a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayNotifyRequest.kt b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayNotifyRequest.kt index 65f5f8a139..907e307184 100644 --- a/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayNotifyRequest.kt +++ b/libraries/push/impl/src/main/kotlin/io/element/android/libraries/push/impl/pushgateway/PushGatewayNotifyRequest.kt @@ -42,9 +42,12 @@ class DefaultPushGatewayNotifyRequest( devices = listOf( PushGatewayDevice( params.appId, - params.pushKey + params.pushKey, + PusherData(mapOf( + "cs" to "A_FAKE_SECRET", + )) ) - ) + ), ) ) )