mirror of
https://github.com/bitwarden/android.git
synced 2026-03-12 05:04:17 -05:00
PM-25194: Fix CollectionTypeJson data type in database (#5786)
This commit is contained in:
@@ -147,7 +147,7 @@ class VaultDiskSourceImpl(
|
||||
isReadOnly = collection.isReadOnly,
|
||||
canManage = collection.canManage,
|
||||
defaultUserCollectionEmail = collection.defaultUserCollectionEmail,
|
||||
type = collection.type,
|
||||
type = json.encodeToString(collection.type),
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -170,7 +170,7 @@ class VaultDiskSourceImpl(
|
||||
isReadOnly = entity.isReadOnly,
|
||||
canManage = entity.canManage,
|
||||
defaultUserCollectionEmail = entity.defaultUserCollectionEmail,
|
||||
type = entity.type,
|
||||
type = json.decodeFromString(entity.type),
|
||||
)
|
||||
}
|
||||
},
|
||||
@@ -295,7 +295,7 @@ class VaultDiskSourceImpl(
|
||||
isReadOnly = collection.isReadOnly,
|
||||
canManage = collection.canManage,
|
||||
defaultUserCollectionEmail = collection.defaultUserCollectionEmail,
|
||||
type = collection.type,
|
||||
type = json.encodeToString(collection.type),
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.x8bit.bitwarden.data.vault.datasource.disk.entity
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import com.bitwarden.network.model.CollectionTypeJson
|
||||
|
||||
/**
|
||||
* Entity representing a collection in the database.
|
||||
@@ -39,5 +38,5 @@ data class CollectionEntity(
|
||||
val defaultUserCollectionEmail: String?,
|
||||
|
||||
@ColumnInfo(name = "type", defaultValue = "0")
|
||||
val type: CollectionTypeJson,
|
||||
val type: String,
|
||||
)
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.x8bit.bitwarden.data.vault.datasource.disk
|
||||
import app.cash.turbine.test
|
||||
import com.bitwarden.core.di.CoreModule
|
||||
import com.bitwarden.data.datasource.disk.base.FakeDispatcherManager
|
||||
import com.bitwarden.network.model.CollectionTypeJson
|
||||
import com.bitwarden.network.model.SyncResponseJson
|
||||
import com.bitwarden.network.model.createMockCipher
|
||||
import com.bitwarden.network.model.createMockCollection
|
||||
@@ -481,7 +480,7 @@ private val COLLECTION_ENTITY = CollectionEntity(
|
||||
isReadOnly = false,
|
||||
canManage = true,
|
||||
defaultUserCollectionEmail = "mockOffboardedUserEmail-3",
|
||||
type = CollectionTypeJson.SHARED_COLLECTION,
|
||||
type = "0",
|
||||
)
|
||||
|
||||
private const val DOMAINS_JSON = """
|
||||
|
||||
Reference in New Issue
Block a user