Fix group recipient being created without a group record.

This commit is contained in:
Cody Henthorne
2026-02-24 14:10:21 -05:00
parent d798a35c38
commit 3437ac63bb
5 changed files with 49 additions and 22 deletions

View File

@@ -1005,14 +1005,16 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
val groupId = GroupId.v2(masterKey)
val values = getValuesForStorageGroupV2(insert, true)
writableDatabase.insertOrThrow(TABLE_NAME, null, values)
val createdId = writableDatabase.withinTransaction {
writableDatabase.insertOrThrow(TABLE_NAME, null, values)
Log.i(TAG, "Creating restore placeholder for $groupId")
val createdId = groups.create(
groupMasterKey = masterKey,
groupState = DecryptedGroup(revision = GroupsV2StateProcessor.RESTORE_PLACEHOLDER_REVISION),
groupSendEndorsements = null
)
Log.i(TAG, "Creating restore placeholder for $groupId")
groups.create(
groupMasterKey = masterKey,
groupState = DecryptedGroup(revision = GroupsV2StateProcessor.RESTORE_PLACEHOLDER_REVISION),
groupSendEndorsements = null
)
}
if (createdId == null) {
Log.w(TAG, "Unable to create restore placeholder for $groupId, group already exists")