improvement: If decodign a cipher fails, prefer the last local copy over a remote one
This commit is contained in:
parent
5ea143bdb9
commit
4651a45216
|
@ -317,7 +317,7 @@ class SyncEngine(
|
||||||
deleted = false,
|
deleted = false,
|
||||||
version = BitwardenService.VERSION,
|
version = BitwardenService.VERSION,
|
||||||
)
|
)
|
||||||
val model = BitwardenFolder(
|
val model = localOrNull?.copy(service = service) ?: BitwardenFolder(
|
||||||
accountId = user.id,
|
accountId = user.id,
|
||||||
folderId = localId,
|
folderId = localId,
|
||||||
revisionDate = remote.revisionDate,
|
revisionDate = remote.revisionDate,
|
||||||
|
@ -543,7 +543,7 @@ class SyncEngine(
|
||||||
deleted = false,
|
deleted = false,
|
||||||
version = BitwardenService.VERSION,
|
version = BitwardenService.VERSION,
|
||||||
)
|
)
|
||||||
val model = BitwardenCipher(
|
val model = localOrNull?.copy(service = service) ?: BitwardenCipher(
|
||||||
accountId = user.id,
|
accountId = user.id,
|
||||||
cipherId = localId,
|
cipherId = localId,
|
||||||
folderId = folderId,
|
folderId = folderId,
|
||||||
|
@ -768,7 +768,7 @@ class SyncEngine(
|
||||||
deleted = false,
|
deleted = false,
|
||||||
version = BitwardenService.VERSION,
|
version = BitwardenService.VERSION,
|
||||||
)
|
)
|
||||||
val model = BitwardenCollection(
|
val model = localOrNull?.copy(service = service) ?: BitwardenCollection(
|
||||||
accountId = user.id,
|
accountId = user.id,
|
||||||
collectionId = remote.id,
|
collectionId = remote.id,
|
||||||
externalId = remote.externalId,
|
externalId = remote.externalId,
|
||||||
|
@ -883,7 +883,7 @@ class SyncEngine(
|
||||||
deleted = false,
|
deleted = false,
|
||||||
version = BitwardenService.VERSION,
|
version = BitwardenService.VERSION,
|
||||||
)
|
)
|
||||||
val model = BitwardenOrganization(
|
val model = localOrNull?.copy(service = service) ?: BitwardenOrganization(
|
||||||
accountId = user.id,
|
accountId = user.id,
|
||||||
organizationId = remote.id,
|
organizationId = remote.id,
|
||||||
revisionDate = now,
|
revisionDate = now,
|
||||||
|
@ -1001,7 +1001,7 @@ class SyncEngine(
|
||||||
deleted = false,
|
deleted = false,
|
||||||
version = BitwardenService.VERSION,
|
version = BitwardenService.VERSION,
|
||||||
)
|
)
|
||||||
val model = BitwardenSend(
|
val model = localOrNull?.copy(service = service) ?: BitwardenSend(
|
||||||
accountId = user.id,
|
accountId = user.id,
|
||||||
sendId = localOrNull?.sendId ?: cryptoGenerator.uuid(),
|
sendId = localOrNull?.sendId ?: cryptoGenerator.uuid(),
|
||||||
revisionDate = now,
|
revisionDate = now,
|
||||||
|
|
Loading…
Reference in New Issue