Skip to content

Commit e77f661

Browse files
committed
Should not try to use the cached state flow as they can be out of date just following config updates
1 parent 931da3f commit e77f661

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

app/src/main/java/org/thoughtcrime/securesms/database/MmsDatabase.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,10 +654,8 @@ class MmsDatabase @Inject constructor(
654654
linkPreviews = retrieved.linkPreviews,
655655
contentValues = contentValues,
656656
)
657-
if (retrieved.messageContent !is DisappearingMessageUpdate) {
658-
if (runThreadUpdate) {
659-
threadDatabase.update(threadId, true)
660-
}
657+
if (runThreadUpdate) {
658+
threadDatabase.update(threadId, true)
661659
}
662660
return Optional.of(InsertResult(messageId, threadId))
663661
}

app/src/main/java/org/thoughtcrime/securesms/database/RecipientRepository.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,6 @@ class RecipientRepository @Inject constructor(
369369
*/
370370
@DelicateCoroutinesApi
371371
fun getRecipientSync(address: Address): Recipient {
372-
// If we have a cached flow, we can try to grab its current value.
373-
val cached = recipientFlowCache[address]?.get()?.replayCache?.firstOrNull()
374-
if (cached != null) {
375-
return cached
376-
}
377-
378-
// Otherwise, we might have to go to the database to get the recipient..
379372
return fetchRecipient(
380373
address = address,
381374
settingsFetcher = recipientSettingsDatabase::getSettings,

0 commit comments

Comments
 (0)