Fix profile fetch debounce bug when profile key changes.

This commit is contained in:
Cody Henthorne
2025-06-17 11:24:26 -04:00
parent 01c106fd3e
commit 3c4f27f3f4
2 changed files with 5 additions and 2 deletions

View File

@@ -1633,6 +1633,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
put(PROFILE_KEY, encodedProfileKey)
putNull(EXPIRING_PROFILE_KEY_CREDENTIAL)
put(SEALED_SENDER_MODE, SealedSenderAccessMode.UNKNOWN.mode)
put(LAST_PROFILE_FETCH, 0)
}
val updateQuery = SqlUtil.buildTrueUpdateQuery(selection, args, valuesToCompare)
@@ -1665,6 +1666,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
put(PROFILE_KEY, Base64.encodeWithPadding(profileKey.serialize()))
putNull(EXPIRING_PROFILE_KEY_CREDENTIAL)
put(SEALED_SENDER_MODE, SealedSenderAccessMode.UNKNOWN.mode)
put(LAST_PROFILE_FETCH, 0)
}
if (writableDatabase.update(TABLE_NAME, valuesToSet, selection, args) > 0) {

View File

@@ -87,12 +87,13 @@ class RetrieveProfileJob private constructor(parameters: Parameters, private val
val stopwatch = Stopwatch("RetrieveProfile")
val recipients = recipientIds.map { Recipient.live(it).refresh().resolve() }
RecipientUtil.ensureUuidsAreAvailable(
context,
Recipient.resolvedList(recipientIds).filter { it.registered != RecipientTable.RegisteredState.NOT_REGISTERED }
recipients.filter { it.registered != RecipientTable.RegisteredState.NOT_REGISTERED }
)
val recipients = Recipient.resolvedList(recipientIds)
stopwatch.split("resolve-ensure")
val currentTime = System.currentTimeMillis()