Fix group recipient resolve race that can cause unknown group recipients in live cache.

This commit is contained in:
Cody Henthorne 2024-04-09 14:59:47 -04:00
parent 2a6977da75
commit 0fcb19e1cc

View file

@ -954,7 +954,6 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
val values = getValuesForStorageGroupV2(insert, true)
writableDatabase.insertOrThrow(TABLE_NAME, null, values)
val recipient = Recipient.externalGroupExact(groupId)
Log.i(TAG, "Creating restore placeholder for $groupId")
val createdId = groups.create(
@ -969,6 +968,9 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
}
groups.setShowAsStoryState(groupId, insert.storySendMode.toShowAsStoryState())
val recipient = Recipient.externalGroupExact(groupId)
updateExtras(recipient.id) {
it.hideStory(insert.shouldHideStory())
}