mirror of
https://github.com/bitwarden/android.git
synced 2025-02-16 11:59:57 +03:00
PM-13726: Process cipher notifications without organizationIds or collectionIds (#4102)
This commit is contained in:
parent
62cfd5e746
commit
cf3624264e
1 changed files with 4 additions and 9 deletions
|
@ -162,19 +162,14 @@ class PushManagerImpl @Inject constructor(
|
||||||
string = notification.payload,
|
string = notification.payload,
|
||||||
)
|
)
|
||||||
.takeIf { isLoggedIn(userId) && it.userMatchesNotification(userId) }
|
.takeIf { isLoggedIn(userId) && it.userMatchesNotification(userId) }
|
||||||
?.takeIf {
|
?.takeIf { it.cipherId != null && it.revisionDate != null }
|
||||||
it.cipherId != null &&
|
|
||||||
it.revisionDate != null &&
|
|
||||||
it.organizationId != null &&
|
|
||||||
it.collectionIds != null
|
|
||||||
}
|
|
||||||
?.let {
|
?.let {
|
||||||
mutableSyncCipherUpsertSharedFlow.tryEmit(
|
mutableSyncCipherUpsertSharedFlow.tryEmit(
|
||||||
SyncCipherUpsertData(
|
SyncCipherUpsertData(
|
||||||
cipherId = requireNotNull(it.cipherId),
|
cipherId = requireNotNull(it.cipherId),
|
||||||
revisionDate = requireNotNull(it.revisionDate),
|
revisionDate = requireNotNull(it.revisionDate),
|
||||||
organizationId = requireNotNull(it.organizationId),
|
organizationId = it.organizationId,
|
||||||
collectionIds = requireNotNull(it.collectionIds),
|
collectionIds = it.collectionIds,
|
||||||
isUpdate = type == NotificationType.SYNC_CIPHER_UPDATE,
|
isUpdate = type == NotificationType.SYNC_CIPHER_UPDATE,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -339,6 +334,6 @@ class PushManagerImpl @Inject constructor(
|
||||||
): Boolean = authDiskSource.getAccountTokens(userId)?.isLoggedIn == true
|
): Boolean = authDiskSource.getAccountTokens(userId)?.isLoggedIn == true
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun NotificationPayload.userMatchesNotification(userId: String?): Boolean {
|
private fun NotificationPayload.userMatchesNotification(userId: String): Boolean {
|
||||||
return this.userId != null && this.userId == userId
|
return this.userId != null && this.userId == userId
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue