From c5293715e177e670451a3b588fe6c0e4859f159e Mon Sep 17 00:00:00 2001 From: Patrick Honkonen <1883101+SaintPatrck@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:56:27 -0500 Subject: [PATCH] [PM-14526] Add JsonNames annotation to SyncResponseJson (#4269) Co-authored-by: David Perez --- .../data/vault/datasource/disk/VaultDiskSourceImpl.kt | 2 -- .../data/vault/datasource/network/model/SyncResponseJson.kt | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceImpl.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceImpl.kt index 204fe787e..9631f1441 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceImpl.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/disk/VaultDiskSourceImpl.kt @@ -17,7 +17,6 @@ import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.merge @@ -125,7 +124,6 @@ class VaultDiskSourceImpl( override fun getDomains(userId: String): Flow = domainsDao .getDomains(userId) - .filterNotNull() .map { entity -> withContext(dispatcherManager.default) { entity?.domainsJson?.let { json.decodeFromString(it) } diff --git a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/model/SyncResponseJson.kt b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/model/SyncResponseJson.kt index d8aec4b85..a0a309fe1 100644 --- a/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/model/SyncResponseJson.kt +++ b/app/src/main/java/com/x8bit/bitwarden/data/vault/datasource/network/model/SyncResponseJson.kt @@ -1,8 +1,10 @@ package com.x8bit.bitwarden.data.vault.datasource.network.model import kotlinx.serialization.Contextual +import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable +import kotlinx.serialization.json.JsonNames import kotlinx.serialization.json.JsonObject import java.time.ZonedDateTime @@ -21,6 +23,7 @@ private const val DEFAULT_FIDO_2_KEY_CURVE = "P-256" * @property domains A domains object associated with the vault data. * @property sends A list of send objects associated with the vault data (nullable). */ +@OptIn(ExperimentalSerializationApi::class) @Serializable data class SyncResponseJson( @SerialName("folders") @@ -30,6 +33,7 @@ data class SyncResponseJson( val collections: List?, @SerialName("profile") + @JsonNames("Profile") val profile: Profile, @SerialName("ciphers") @@ -39,6 +43,7 @@ data class SyncResponseJson( val policies: List?, @SerialName("domains") + @JsonNames("Domains") val domains: Domains?, @SerialName("sends")