mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-24 11:45:28 +00:00
Fix profile fetch debounce bug when profile key changes.
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user