From 37a53d42d4f0c68dc5f261275f4297e85d9c84a8 Mon Sep 17 00:00:00 2001 From: David Perez Date: Tue, 18 Jun 2024 14:30:24 -0500 Subject: [PATCH] Remove legacy GCM notification support (#1464) --- .../data/platform/manager/PushManager.kt | 9 +- .../data/platform/manager/PushManagerImpl.kt | 5 - .../manager/model/BitwardenNotification.kt | 10 +- .../push/BitwardenFirebaseMessagingService.kt | 5 +- .../data/platform/manager/PushManagerTest.kt | 866 ++---------------- 5 files changed, 98 insertions(+), 797 deletions(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManager.kt b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManager.kt index 1e5fd655884..c5a205199dc 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManager.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManager.kt @@ -65,14 +65,7 @@ interface PushManager { val syncSendUpsertFlow: Flow /** - * Handles the necessary steps to take when a push notification with a legacy FCM [data] - * payload is received. - */ - fun onMessageReceived(data: String) - - /** - * Handles the necessary steps to take when a push notification with FCM v1 payload is - * received. + * Handles the necessary steps to take when a push notification payload is received. */ fun onMessageReceived(data: Map) diff --git a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManagerImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManagerImpl.kt index 3c5b75b4d76..c60e6b56bd3 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManagerImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/PushManagerImpl.kt @@ -107,11 +107,6 @@ class PushManagerImpl @Inject constructor( .launchIn(unconfinedScope) } - override fun onMessageReceived(data: String) { - val notification = json.decodeFromStringOrNull(data) ?: return - onMessageReceived(notification) - } - override fun onMessageReceived(data: Map) { val notificationType = data["type"] ?.let { json.decodeFromStringOrNull(string = it) } diff --git a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/BitwardenNotification.kt b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/BitwardenNotification.kt index 7a5bfb7a59b..5e2a3af33a8 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/BitwardenNotification.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/platform/manager/model/BitwardenNotification.kt @@ -1,8 +1,5 @@ package com.x8bit.bitwarden.data.platform.manager.model -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable - /** * Represents a Bitwarden push notification. * @@ -11,9 +8,8 @@ import kotlinx.serialization.Serializable * @property notificationType The type of notification. * @property payload Data associated with the push notification. */ -@Serializable data class BitwardenNotification( - @SerialName("contextId") val contextId: String?, - @SerialName("type") val notificationType: NotificationType, - @SerialName("payload") val payload: String, + val contextId: String?, + val notificationType: NotificationType, + val payload: String, ) diff --git a/app/src/standard/java/com/x8bit/bitwarden/data/push/BitwardenFirebaseMessagingService.kt b/app/src/standard/java/com/x8bit/bitwarden/data/push/BitwardenFirebaseMessagingService.kt index e75b7ec591f..fecca8cf33c 100644 --- a/app/src/standard/java/com/x8bit/bitwarden/data/push/BitwardenFirebaseMessagingService.kt +++ b/app/src/standard/java/com/x8bit/bitwarden/data/push/BitwardenFirebaseMessagingService.kt @@ -17,10 +17,7 @@ class BitwardenFirebaseMessagingService : FirebaseMessagingService() { lateinit var pushManager: PushManager override fun onMessageReceived(message: RemoteMessage) { - message - .data["data"] - ?.let { pushManager.onMessageReceived(it) } - ?: pushManager.onMessageReceived(message.data) + pushManager.onMessageReceived(message.data) } override fun onNewToken(token: String) { diff --git a/app/src/test/java/com/x8bit/bitwarden/data/platform/manager/PushManagerTest.kt b/app/src/test/java/com/x8bit/bitwarden/data/platform/manager/PushManagerTest.kt index 7d1f268a224..c1ed233944e 100644 --- a/app/src/test/java/com/x8bit/bitwarden/data/platform/manager/PushManagerTest.kt +++ b/app/src/test/java/com/x8bit/bitwarden/data/platform/manager/PushManagerTest.kt @@ -82,64 +82,26 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with invalid JSON does not crash`() { - pushManager.onMessageReceived(INVALID_NOTIFICATION_JSON) - } - - @Test - fun `onMessageReceived for map data with invalid JSON does not crash`() { + fun `onMessageReceived with invalid JSON does not crash`() { pushManager.onMessageReceived(INVALID_NOTIFICATION_MAP) } @Test - fun `onMessageReceived for raw data with auth request emits to passwordlessRequestFlow`() = - runTest { - pushManager.passwordlessRequestFlow.test { - pushManager.onMessageReceived(AUTH_REQUEST_NOTIFICATION_JSON) - assertEquals( - PasswordlessRequestData( - loginRequestId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - userId = "078966a2-93c2-4618-ae2a-0a2394c88d37", - ), - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for map data with auth request emits to passwordlessRequestFlow`() = - runTest { - pushManager.passwordlessRequestFlow.test { - pushManager.onMessageReceived(AUTH_REQUEST_NOTIFICATION_MAP) - assertEquals( - PasswordlessRequestData( - loginRequestId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - userId = "078966a2-93c2-4618-ae2a-0a2394c88d37", - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for raw data with auth request response emits to passwordlessRequestFlow`() = - runTest { - pushManager.passwordlessRequestFlow.test { - pushManager.onMessageReceived(AUTH_REQUEST_RESPONSE_NOTIFICATION_JSON) - assertEquals( - PasswordlessRequestData( - loginRequestId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - userId = "078966a2-93c2-4618-ae2a-0a2394c88d37", - ), - awaitItem(), - ) - } + fun `onMessageReceived with auth request emits to passwordlessRequestFlow`() = runTest { + pushManager.passwordlessRequestFlow.test { + pushManager.onMessageReceived(AUTH_REQUEST_NOTIFICATION_MAP) + assertEquals( + PasswordlessRequestData( + loginRequestId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", + userId = "078966a2-93c2-4618-ae2a-0a2394c88d37", + ), + awaitItem(), + ) } + } - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for map data with auth request response emits to passwordlessRequestFlow`() = + fun `onMessageReceived with auth request response emits to passwordlessRequestFlow`() = runTest { pushManager.passwordlessRequestFlow.test { pushManager.onMessageReceived(AUTH_REQUEST_RESPONSE_NOTIFICATION_MAP) @@ -154,25 +116,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with logout should emit to logoutFlow`() = runTest { - val accountTokens = AccountTokensJson( - accessToken = "accessToken", - refreshToken = "refreshToken", - ) - authDiskSource.storeAccountTokens(userId, accountTokens) - authDiskSource.userState = UserStateJson(userId, mapOf(userId to mockk())) - - pushManager.logoutFlow.test { - pushManager.onMessageReceived(LOGOUT_NOTIFICATION_JSON) - assertEquals( - NotificationLogoutData(userId = "078966a2-93c2-4618-ae2a-0a2394c88d37"), - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for map data with logout should emit to logoutFlow`() = runTest { + fun `onMessageReceived with logout should emit to logoutFlow`() = runTest { val accountTokens = AccountTokensJson( accessToken = "accessToken", refreshToken = "refreshToken", @@ -200,18 +144,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with logout emits to logoutFlow`() = runTest { - pushManager.logoutFlow.test { - pushManager.onMessageReceived(LOGOUT_NOTIFICATION_JSON) - assertEquals( - NotificationLogoutData(userId = "078966a2-93c2-4618-ae2a-0a2394c88d37"), - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for map data with logout emits to logoutFlow`() = runTest { + fun `onMessageReceived with logout emits to logoutFlow`() = runTest { pushManager.logoutFlow.test { pushManager.onMessageReceived(LOGOUT_NOTIFICATION_MAP) assertEquals( @@ -222,19 +155,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync ciphers emits to fullSyncFlow`() = - runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_CIPHERS_NOTIFICATION_JSON) - assertEquals( - Unit, - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for map data with ciphers emits to fullSyncFlow`() = runTest { + fun `onMessageReceived with ciphers emits to fullSyncFlow`() = runTest { pushManager.fullSyncFlow.test { pushManager.onMessageReceived(SYNC_CIPHERS_NOTIFICATION_MAP) assertEquals( @@ -245,15 +166,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync org keys does nothing`() = runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_ORG_KEYS_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync org keys does nothing`() = runTest { + fun `onMessageReceived with sync org keys does nothing`() = runTest { pushManager.fullSyncFlow.test { pushManager.onMessageReceived(SYNC_ORG_KEYS_NOTIFICATION_MAP) expectNoEvents() @@ -261,33 +174,9 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync settings emits to fullSyncFlow`() = - runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_SETTINGS_NOTIFICATION_JSON) - assertEquals( - Unit, - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for map data with sync settings emits to fullSyncFlow`() = - runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_SETTINGS_NOTIFICATION_MAP) - assertEquals( - Unit, - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for raw data with sync vault emits to fullSyncFlow`() = runTest { + fun `onMessageReceived with sync settings emits to fullSyncFlow`() = runTest { pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_VAULT_NOTIFICATION_JSON) + pushManager.onMessageReceived(SYNC_SETTINGS_NOTIFICATION_MAP) assertEquals( Unit, awaitItem(), @@ -296,7 +185,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for map data with vault emits to fullSyncFlow`() = runTest { + fun `onMessageReceived with vault emits to fullSyncFlow`() = runTest { pushManager.fullSyncFlow.test { pushManager.onMessageReceived(SYNC_VAULT_NOTIFICATION_MAP) assertEquals( @@ -321,28 +210,8 @@ class PushManagerTest { authDiskSource.userState = UserStateJson(userId, mapOf(userId to account)) } - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for raw data with sync cipher create emits to syncCipherUpsertFlow`() = - runTest { - pushManager.syncCipherUpsertFlow.test { - pushManager.onMessageReceived(SYNC_CIPHER_CREATE_NOTIFICATION_JSON) - assertEquals( - SyncCipherUpsertData( - cipherId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - organizationId = "6a41d965-ed95-4eae-98c3-5f1ec609c2c1", - collectionIds = listOf(), - revisionDate = ZonedDateTime.parse("2023-10-27T12:00:00.000Z"), - isUpdate = false, - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for map data with sync cipher create emits to syncCipherUpsertFlow`() = + fun `onMessageReceived with sync cipher create emits to syncCipherUpsertFlow`() = runTest { pushManager.syncCipherUpsertFlow.test { pushManager.onMessageReceived(SYNC_CIPHER_CREATE_NOTIFICATION_MAP) @@ -359,24 +228,8 @@ class PushManagerTest { } } - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for raw data with sync cipher delete emits to syncCipherDeleteFlow`() = - runTest { - pushManager.syncCipherDeleteFlow.test { - pushManager.onMessageReceived(SYNC_CIPHER_DELETE_NOTIFICATION_JSON) - assertEquals( - SyncCipherDeleteData( - cipherId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for map data with sync cipher delete emits to syncCipherDeleteFlow`() = + fun `onMessageReceived with sync cipher delete emits to syncCipherDeleteFlow`() = runTest { pushManager.syncCipherDeleteFlow.test { pushManager.onMessageReceived(SYNC_CIPHER_DELETE_NOTIFICATION_MAP) @@ -389,28 +242,8 @@ class PushManagerTest { } } - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for raw data with sync cipher update emits to syncCipherUpsertFlow`() = - runTest { - pushManager.syncCipherUpsertFlow.test { - pushManager.onMessageReceived(SYNC_CIPHER_UPDATE_NOTIFICATION_JSON) - assertEquals( - SyncCipherUpsertData( - cipherId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - organizationId = "6a41d965-ed95-4eae-98c3-5f1ec609c2c1", - collectionIds = listOf(), - revisionDate = ZonedDateTime.parse("2023-10-27T12:00:00.000Z"), - isUpdate = true, - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for map data with sync cipher update emits to syncCipherUpsertFlow`() = + fun `onMessageReceived with sync cipher update emits to syncCipherUpsertFlow`() = runTest { pushManager.syncCipherUpsertFlow.test { pushManager.onMessageReceived(SYNC_CIPHER_UPDATE_NOTIFICATION_MAP) @@ -427,26 +260,8 @@ class PushManagerTest { } } - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for raw data with sync folder create emits to syncFolderUpsertFlow`() = - runTest { - pushManager.syncFolderUpsertFlow.test { - pushManager.onMessageReceived(SYNC_FOLDER_CREATE_NOTIFICATION_JSON) - assertEquals( - SyncFolderUpsertData( - folderId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - revisionDate = ZonedDateTime.parse("2023-10-27T12:00:00.000Z"), - isUpdate = false, - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for map data with sync folder create emits to syncFolderUpsertFlow`() = + fun `onMessageReceived with sync folder create emits to syncFolderUpsertFlow`() = runTest { pushManager.syncFolderUpsertFlow.test { pushManager.onMessageReceived(SYNC_FOLDER_CREATE_NOTIFICATION_MAP) @@ -461,24 +276,8 @@ class PushManagerTest { } } - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for raw data with sync folder delete emits to syncFolderDeleteFlow`() = - runTest { - pushManager.syncFolderDeleteFlow.test { - pushManager.onMessageReceived(SYNC_FOLDER_DELETE_NOTIFICATION_JSON) - assertEquals( - SyncFolderDeleteData( - folderId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for map data with sync folder delete emits to syncFolderDeleteFlow`() = + fun `onMessageReceived with sync folder delete emits to syncFolderDeleteFlow`() = runTest { pushManager.syncFolderDeleteFlow.test { pushManager.onMessageReceived(SYNC_FOLDER_DELETE_NOTIFICATION_MAP) @@ -491,26 +290,8 @@ class PushManagerTest { } } - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for raw data with sync folder update emits to syncFolderUpsertFlow`() = - runTest { - pushManager.syncFolderUpsertFlow.test { - pushManager.onMessageReceived(SYNC_FOLDER_UPDATE_NOTIFICATION_JSON) - assertEquals( - SyncFolderUpsertData( - folderId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - revisionDate = ZonedDateTime.parse("2023-10-27T12:00:00.000Z"), - isUpdate = true, - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for map data with sync folder update emits to syncFolderUpsertFlow`() = + fun `onMessageReceived with sync folder update emits to syncFolderUpsertFlow`() = runTest { pushManager.syncFolderUpsertFlow.test { pushManager.onMessageReceived(SYNC_FOLDER_UPDATE_NOTIFICATION_MAP) @@ -525,24 +306,8 @@ class PushManagerTest { } } - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for raw data with sync login delete emits to syncCipherDeleteFlow`() = - runTest { - pushManager.syncCipherDeleteFlow.test { - pushManager.onMessageReceived(SYNC_LOGIN_DELETE_NOTIFICATION_JSON) - assertEquals( - SyncCipherDeleteData( - cipherId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for map data with sync login delete emits to syncCipherDeleteFlow`() = + fun `onMessageReceived with sync login delete emits to syncCipherDeleteFlow`() = runTest { pushManager.syncCipherDeleteFlow.test { pushManager.onMessageReceived(SYNC_LOGIN_DELETE_NOTIFICATION_MAP) @@ -555,103 +320,48 @@ class PushManagerTest { } } - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for raw data with sync send create emits to syncSendUpsertFlow`() = - runTest { - pushManager.syncSendUpsertFlow.test { - pushManager.onMessageReceived(SYNC_SEND_CREATE_NOTIFICATION_JSON) - assertEquals( - SyncSendUpsertData( - sendId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - revisionDate = ZonedDateTime.parse("2023-10-27T12:00:00.000Z"), - isUpdate = false, - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for map data with sync send create emits to syncSendUpsertFlow`() = - runTest { - pushManager.syncSendUpsertFlow.test { - pushManager.onMessageReceived(SYNC_SEND_CREATE_NOTIFICATION_MAP) - assertEquals( - SyncSendUpsertData( - sendId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - revisionDate = ZonedDateTime.parse("2023-10-27T12:00:00.000Z"), - isUpdate = false, - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for raw data with sync send delete emits to syncSendDeleteFlow`() = - runTest { - pushManager.syncSendDeleteFlow.test { - pushManager.onMessageReceived(SYNC_SEND_DELETE_NOTIFICATION_JSON) - assertEquals( - SyncSendDeleteData( - sendId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - ), - awaitItem(), - ) - } - } - - @Suppress("MaxLineLength") - @Test - fun `onMessageReceived for map data with sync send delete emits to syncSendDeleteFlow`() = - runTest { - pushManager.syncSendDeleteFlow.test { - pushManager.onMessageReceived(SYNC_SEND_DELETE_NOTIFICATION_MAP) - assertEquals( - SyncSendDeleteData( - sendId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - ), - awaitItem(), - ) - } + fun `onMessageReceived with sync send create emits to syncSendUpsertFlow`() = runTest { + pushManager.syncSendUpsertFlow.test { + pushManager.onMessageReceived(SYNC_SEND_CREATE_NOTIFICATION_MAP) + assertEquals( + SyncSendUpsertData( + sendId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", + revisionDate = ZonedDateTime.parse("2023-10-27T12:00:00.000Z"), + isUpdate = false, + ), + awaitItem(), + ) } + } - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for raw data with sync send update emits to syncSendUpsertFlow`() = - runTest { - pushManager.syncSendUpsertFlow.test { - pushManager.onMessageReceived(SYNC_SEND_UPDATE_NOTIFICATION_JSON) - assertEquals( - SyncSendUpsertData( - sendId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - revisionDate = ZonedDateTime.parse("2023-10-27T12:00:00.000Z"), - isUpdate = true, - ), - awaitItem(), - ) - } + fun `onMessageReceived with sync send delete emits to syncSendDeleteFlow`() = runTest { + pushManager.syncSendDeleteFlow.test { + pushManager.onMessageReceived(SYNC_SEND_DELETE_NOTIFICATION_MAP) + assertEquals( + SyncSendDeleteData( + sendId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", + ), + awaitItem(), + ) } + } - @Suppress("MaxLineLength") @Test - fun `onMessageReceived for map data with sync send update emits to syncSendUpsertFlow`() = - runTest { - pushManager.syncSendUpsertFlow.test { - pushManager.onMessageReceived(SYNC_SEND_UPDATE_NOTIFICATION_MAP) - assertEquals( - SyncSendUpsertData( - sendId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", - revisionDate = ZonedDateTime.parse("2023-10-27T12:00:00.000Z"), - isUpdate = true, - ), - awaitItem(), - ) - } + fun `onMessageReceived with sync send update emits to syncSendUpsertFlow`() = runTest { + pushManager.syncSendUpsertFlow.test { + pushManager.onMessageReceived(SYNC_SEND_UPDATE_NOTIFICATION_MAP) + assertEquals( + SyncSendUpsertData( + sendId = "aab5cdcc-f4a7-4e65-bf6d-5e0eab052321", + revisionDate = ZonedDateTime.parse("2023-10-27T12:00:00.000Z"), + isUpdate = true, + ), + awaitItem(), + ) } + } } @Nested @@ -669,15 +379,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync cipher create does nothing`() = runTest { - pushManager.syncCipherUpsertFlow.test { - pushManager.onMessageReceived(SYNC_CIPHER_CREATE_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync cipher create does nothing`() = runTest { + fun `onMessageReceived with sync cipher create does nothing`() = runTest { pushManager.syncCipherUpsertFlow.test { pushManager.onMessageReceived(SYNC_CIPHER_CREATE_NOTIFICATION_MAP) expectNoEvents() @@ -685,15 +387,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync cipher delete does nothing`() = runTest { - pushManager.syncCipherDeleteFlow.test { - pushManager.onMessageReceived(SYNC_CIPHER_DELETE_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync cipher delete does nothing`() = runTest { + fun `onMessageReceived with sync cipher delete does nothing`() = runTest { pushManager.syncCipherDeleteFlow.test { pushManager.onMessageReceived(SYNC_CIPHER_DELETE_NOTIFICATION_MAP) expectNoEvents() @@ -701,15 +395,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync cipher update does nothing`() = runTest { - pushManager.syncCipherUpsertFlow.test { - pushManager.onMessageReceived(SYNC_CIPHER_UPDATE_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync cipher update does nothing`() = runTest { + fun `onMessageReceived with sync cipher update does nothing`() = runTest { pushManager.syncCipherUpsertFlow.test { pushManager.onMessageReceived(SYNC_CIPHER_UPDATE_NOTIFICATION_MAP) expectNoEvents() @@ -717,15 +403,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync folder create does nothing`() = runTest { - pushManager.syncFolderUpsertFlow.test { - pushManager.onMessageReceived(SYNC_FOLDER_CREATE_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync folder create does nothing`() = runTest { + fun `onMessageReceived with sync folder create does nothing`() = runTest { pushManager.syncFolderUpsertFlow.test { pushManager.onMessageReceived(SYNC_FOLDER_CREATE_NOTIFICATION_MAP) expectNoEvents() @@ -733,15 +411,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync folder delete does nothing`() = runTest { - pushManager.syncFolderDeleteFlow.test { - pushManager.onMessageReceived(SYNC_FOLDER_DELETE_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync folder delete does nothing`() = runTest { + fun `onMessageReceived with sync folder delete does nothing`() = runTest { pushManager.syncFolderDeleteFlow.test { pushManager.onMessageReceived(SYNC_FOLDER_DELETE_NOTIFICATION_MAP) expectNoEvents() @@ -749,15 +419,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync folder update does nothing`() = runTest { - pushManager.syncFolderDeleteFlow.test { - pushManager.onMessageReceived(SYNC_FOLDER_UPDATE_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync folder update does nothing`() = runTest { + fun `onMessageReceived with sync folder update does nothing`() = runTest { pushManager.syncFolderDeleteFlow.test { pushManager.onMessageReceived(SYNC_FOLDER_UPDATE_NOTIFICATION_MAP) expectNoEvents() @@ -765,15 +427,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync login delete does nothing`() = runTest { - pushManager.syncCipherDeleteFlow.test { - pushManager.onMessageReceived(SYNC_LOGIN_DELETE_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync login delete does nothing`() = runTest { + fun `onMessageReceived with sync login delete does nothing`() = runTest { pushManager.syncCipherDeleteFlow.test { pushManager.onMessageReceived(SYNC_LOGIN_DELETE_NOTIFICATION_MAP) expectNoEvents() @@ -781,15 +435,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync send create does nothing`() = runTest { - pushManager.syncSendUpsertFlow.test { - pushManager.onMessageReceived(SYNC_SEND_CREATE_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync send create does nothing`() = runTest { + fun `onMessageReceived with sync send create does nothing`() = runTest { pushManager.syncSendUpsertFlow.test { pushManager.onMessageReceived(SYNC_SEND_CREATE_NOTIFICATION_MAP) expectNoEvents() @@ -797,15 +443,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync send delete does nothing`() = runTest { - pushManager.syncSendDeleteFlow.test { - pushManager.onMessageReceived(SYNC_SEND_DELETE_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync send delete does nothing`() = runTest { + fun `onMessageReceived with sync send delete does nothing`() = runTest { pushManager.syncSendDeleteFlow.test { pushManager.onMessageReceived(SYNC_SEND_DELETE_NOTIFICATION_MAP) expectNoEvents() @@ -813,15 +451,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync send update does nothing`() = runTest { - pushManager.syncSendUpsertFlow.test { - pushManager.onMessageReceived(SYNC_SEND_UPDATE_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync send update does nothing`() = runTest { + fun `onMessageReceived with sync send update does nothing`() = runTest { pushManager.syncSendUpsertFlow.test { pushManager.onMessageReceived(SYNC_SEND_UPDATE_NOTIFICATION_MAP) expectNoEvents() @@ -837,15 +467,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with logout does nothing`() = runTest { - pushManager.logoutFlow.test { - pushManager.onMessageReceived(LOGOUT_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with logout does nothing`() = runTest { + fun `onMessageReceived with logout does nothing`() = runTest { pushManager.logoutFlow.test { pushManager.onMessageReceived(LOGOUT_NOTIFICATION_MAP) expectNoEvents() @@ -853,15 +475,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync ciphers does nothing`() = runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_CIPHERS_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync ciphers does nothing`() = runTest { + fun `onMessageReceived with sync ciphers does nothing`() = runTest { pushManager.fullSyncFlow.test { pushManager.onMessageReceived(SYNC_CIPHERS_NOTIFICATION_MAP) expectNoEvents() @@ -869,15 +483,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync org keys does nothing`() = runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_ORG_KEYS_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync org keys does nothing`() = runTest { + fun `onMessageReceived with sync org keys does nothing`() = runTest { pushManager.fullSyncFlow.test { pushManager.onMessageReceived(SYNC_ORG_KEYS_NOTIFICATION_MAP) expectNoEvents() @@ -885,15 +491,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync settings does nothing`() = runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_SETTINGS_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync settings does nothing`() = runTest { + fun `onMessageReceived with sync settings does nothing`() = runTest { pushManager.fullSyncFlow.test { pushManager.onMessageReceived(SYNC_SETTINGS_NOTIFICATION_MAP) expectNoEvents() @@ -901,15 +499,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with sync vault does nothing`() = runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_VAULT_NOTIFICATION_JSON) - expectNoEvents() - } - } - - @Test - fun `onMessageReceived for map data with sync vault does nothing`() = runTest { + fun `onMessageReceived with sync vault does nothing`() = runTest { pushManager.fullSyncFlow.test { pushManager.onMessageReceived(SYNC_VAULT_NOTIFICATION_MAP) expectNoEvents() @@ -932,9 +522,9 @@ class PushManagerTest { } @Test - fun `onMessageReceived for raw data with logout emits to logoutFlow`() = runTest { + fun `onMessageReceived with logout emits to logoutFlow`() = runTest { pushManager.logoutFlow.test { - pushManager.onMessageReceived(LOGOUT_NOTIFICATION_JSON) + pushManager.onMessageReceived(LOGOUT_NOTIFICATION_MAP) assertEquals( NotificationLogoutData(userId = "078966a2-93c2-4618-ae2a-0a2394c88d37"), awaitItem(), @@ -943,92 +533,31 @@ class PushManagerTest { } @Test - fun `onMessageReceived for map data with logout emits to logoutFlow`() = runTest { - pushManager.logoutFlow.test { - pushManager.onMessageReceived(LOGOUT_NOTIFICATION_MAP) + fun `onMessageReceived with sync ciphers emits to fullSyncFlow`() = runTest { + pushManager.fullSyncFlow.test { + pushManager.onMessageReceived(SYNC_CIPHERS_NOTIFICATION_MAP) assertEquals( - NotificationLogoutData(userId = "078966a2-93c2-4618-ae2a-0a2394c88d37"), + Unit, awaitItem(), ) } } @Test - fun `onMessageReceived for raw data with sync ciphers emits to fullSyncFlow`() = - runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_CIPHERS_NOTIFICATION_JSON) - assertEquals( - Unit, - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for map data with sync ciphers emits to fullSyncFlow`() = - runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_CIPHERS_NOTIFICATION_MAP) - assertEquals( - Unit, - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for raw data with sync org keys emits to syncOrgKeysFlow`() = - runTest { - pushManager.syncOrgKeysFlow.test { - pushManager.onMessageReceived(SYNC_ORG_KEYS_NOTIFICATION_JSON) - assertEquals( - Unit, - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for map data with sync org keys emits to syncOrgKeysFlow`() = - runTest { - pushManager.syncOrgKeysFlow.test { - pushManager.onMessageReceived(SYNC_ORG_KEYS_NOTIFICATION_MAP) - assertEquals( - Unit, - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for raw data with sync settings emits to fullSyncFlow`() = - runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_SETTINGS_NOTIFICATION_JSON) - assertEquals( - Unit, - awaitItem(), - ) - } - } - - @Test - fun `onMessageReceived for map data with sync settings emits to fullSyncFlow`() = - runTest { - pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_SETTINGS_NOTIFICATION_MAP) - assertEquals( - Unit, - awaitItem(), - ) - } + fun `onMessageReceived with sync org keys emits to syncOrgKeysFlow`() = runTest { + pushManager.syncOrgKeysFlow.test { + pushManager.onMessageReceived(SYNC_ORG_KEYS_NOTIFICATION_MAP) + assertEquals( + Unit, + awaitItem(), + ) } + } @Test - fun `onMessageReceived for raw data with sync vault emits to fullSyncFlow`() = runTest { + fun `onMessageReceived with sync settings emits to fullSyncFlow`() = runTest { pushManager.fullSyncFlow.test { - pushManager.onMessageReceived(SYNC_VAULT_NOTIFICATION_JSON) + pushManager.onMessageReceived(SYNC_SETTINGS_NOTIFICATION_MAP) assertEquals( Unit, awaitItem(), @@ -1037,7 +566,7 @@ class PushManagerTest { } @Test - fun `onMessageReceived for map data with sync vault emits to fullSyncFlow`() = runTest { + fun `onMessageReceived with sync vault emits to fullSyncFlow`() = runTest { pushManager.fullSyncFlow.test { pushManager.onMessageReceived(SYNC_VAULT_NOTIFICATION_MAP) assertEquals( @@ -1264,17 +793,6 @@ class PushManagerTest { } } -private const val AUTH_REQUEST_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 15, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\" - }" - } -""" - private val AUTH_REQUEST_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "15", @@ -1284,17 +802,6 @@ private val AUTH_REQUEST_NOTIFICATION_MAP = mapOf( }""", ) -private const val AUTH_REQUEST_RESPONSE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 16, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\" - }" - } -""" - private val AUTH_REQUEST_RESPONSE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "16", @@ -1304,23 +811,8 @@ private val AUTH_REQUEST_RESPONSE_NOTIFICATION_MAP = mapOf( }""", ) -private const val INVALID_NOTIFICATION_JSON = """ - {} -""" - private val INVALID_NOTIFICATION_MAP = emptyMap() -private const val LOGOUT_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 11, - "payload": "{ - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"Date\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val LOGOUT_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "11", @@ -1330,20 +822,6 @@ private val LOGOUT_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_CIPHER_CREATE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 1, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"OrganizationId\": \"6a41d965-ed95-4eae-98c3-5f1ec609c2c1\", - \"CollectionIds\": [], - \"RevisionDate\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_CIPHER_CREATE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "1", @@ -1356,20 +834,6 @@ private val SYNC_CIPHER_CREATE_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_CIPHER_DELETE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 9, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"OrganizationId\": \"6a41d965-ed95-4eae-98c3-5f1ec609c2c1\", - \"CollectionIds\": [], - \"RevisionDate\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_CIPHER_DELETE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "9", @@ -1382,20 +846,6 @@ private val SYNC_CIPHER_DELETE_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_CIPHER_UPDATE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 0, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"OrganizationId\": \"6a41d965-ed95-4eae-98c3-5f1ec609c2c1\", - \"CollectionIds\": [], - \"RevisionDate\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_CIPHER_UPDATE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "0", @@ -1408,17 +858,6 @@ private val SYNC_CIPHER_UPDATE_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_CIPHERS_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 4, - "payload": "{ - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"Date\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_CIPHERS_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "4", @@ -1428,18 +867,6 @@ private val SYNC_CIPHERS_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_FOLDER_CREATE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 7, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"RevisionDate\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_FOLDER_CREATE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "7", @@ -1450,18 +877,6 @@ private val SYNC_FOLDER_CREATE_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_FOLDER_DELETE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 3, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"RevisionDate\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_FOLDER_DELETE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "3", @@ -1472,18 +887,6 @@ private val SYNC_FOLDER_DELETE_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_FOLDER_UPDATE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 8, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"RevisionDate\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_FOLDER_UPDATE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "8", @@ -1494,20 +897,6 @@ private val SYNC_FOLDER_UPDATE_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_LOGIN_DELETE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 2, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"OrganizationId\": \"6a41d965-ed95-4eae-98c3-5f1ec609c2c1\", - \"CollectionIds\": [], - \"RevisionDate\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_LOGIN_DELETE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "2", @@ -1520,17 +909,6 @@ private val SYNC_LOGIN_DELETE_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_ORG_KEYS_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 6, - "payload": "{ - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"Date\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_ORG_KEYS_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "6", @@ -1540,18 +918,6 @@ private val SYNC_ORG_KEYS_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_SEND_CREATE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 12, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"RevisionDate\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_SEND_CREATE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "12", @@ -1562,18 +928,6 @@ private val SYNC_SEND_CREATE_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_SEND_DELETE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 14, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"RevisionDate\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_SEND_DELETE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "14", @@ -1584,18 +938,6 @@ private val SYNC_SEND_DELETE_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_SEND_UPDATE_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 13, - "payload": "{ - \"Id\": \"aab5cdcc-f4a7-4e65-bf6d-5e0eab052321\", - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"RevisionDate\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_SEND_UPDATE_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "13", @@ -1606,17 +948,6 @@ private val SYNC_SEND_UPDATE_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_SETTINGS_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 10, - "payload": "{ - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"Date\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_SETTINGS_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "10", @@ -1626,17 +957,6 @@ private val SYNC_SETTINGS_NOTIFICATION_MAP = mapOf( }""", ) -private const val SYNC_VAULT_NOTIFICATION_JSON = """ - { - "contextId": "801f459d-8e51-47d0-b072-3f18c9f66f64", - "type": 5, - "payload": "{ - \"UserId\": \"078966a2-93c2-4618-ae2a-0a2394c88d37\", - \"Date\": \"2023-10-27T12:00:00.000Z\" - }" - } -""" - private val SYNC_VAULT_NOTIFICATION_MAP = mapOf( "contextId" to "801f459d-8e51-47d0-b072-3f18c9f66f64", "type" to "5",