mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-19 08:09:12 +01:00
committed by
jeffrey-signal
parent
0ea3d524da
commit
9be82a2739
@@ -1263,8 +1263,16 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
for (id in groups.getAllGroupV2Ids()) {
|
||||
val recipient = Recipient.externalGroupExact(id)
|
||||
val recipientId = recipient.id
|
||||
val existing: RecipientRecord = getRecordForSync(recipientId) ?: throw AssertionError()
|
||||
val key = existing.storageId ?: throw AssertionError()
|
||||
var existing: RecipientRecord = getRecordForSync(recipientId) ?: throw AssertionError("Failed to find recipient record!")
|
||||
var key = existing.storageId
|
||||
|
||||
if (key == null) {
|
||||
Log.w(TAG, "Needed to repair storageId for $recipientId (group $id)")
|
||||
rotateStorageId(existing.id)
|
||||
existing = getRecordForSync(recipientId) ?: throw AssertionError("Failed to find recipient record for second fetch!")
|
||||
key = existing.storageId ?: throw AssertionError("StorageId not present immediately after setting it!")
|
||||
}
|
||||
|
||||
out[recipientId] = StorageId.forGroupV2(key)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user