Merge pull request #1029 from session-foundation/release/1.21.2

Prepare for release 1.21.2
pull/1713/head
SessionHero01 1 month ago committed by GitHub
commit 1dc88125c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -15,8 +15,8 @@ configurations.configureEach {
exclude module: "commons-logging"
}
def canonicalVersionCode = 397
def canonicalVersionName = "1.21.1"
def canonicalVersionCode = 398
def canonicalVersionName = "1.21.2"
def postFixSize = 10
def abiPostFix = ['armeabi-v7a' : 1,

@ -170,7 +170,7 @@ public class ApplicationContext extends Application implements DefaultLifecycleO
@Inject ConfigUploader configUploader;
@Inject AdminStateSync adminStateSync;
@Inject DestroyedGroupSync destroyedGroupSync;
@Inject RemoveGroupMemberHandler removeGroupMemberHandler;
@Inject RemoveGroupMemberHandler removeGroupMemberHandler; // Exists here only to start upon app starts
@Inject SnodeClock snodeClock;
@Inject ExpiringMessageManager expiringMessageManager;
@Inject TypingStatusRepository typingStatusRepository;
@ -302,7 +302,6 @@ public class ApplicationContext extends Application implements DefaultLifecycleO
snodeClock.start();
pushRegistrationHandler.run();
configUploader.start();
removeGroupMemberHandler.start();
destroyedGroupSync.start();
adminStateSync.start();
cleanupInvitationHandler.start();

@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.groups.handler
import android.content.Context
import com.google.protobuf.ByteString
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
@ -49,6 +50,7 @@ private const val TAG = "RemoveGroupMemberHandler"
*
* It automatically does so by listening to the config updates changes and checking for any pending removals.
*/
@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
@Singleton
class RemoveGroupMemberHandler @Inject constructor(
@ApplicationContext private val context: Context,
@ -59,13 +61,8 @@ class RemoveGroupMemberHandler @Inject constructor(
private val storage: StorageProtocol,
private val groupScope: GroupScope,
) {
private var job: Job? = null
@OptIn(ExperimentalCoroutinesApi::class)
fun start() {
require(job == null) { "Already started" }
job = GlobalScope.launch {
init {
GlobalScope.launch {
textSecurePreferences
.watchLocalNumber()
.flatMapLatest { localNumber ->
@ -80,14 +77,17 @@ class RemoveGroupMemberHandler @Inject constructor(
val adminKey = configFactory.getGroup(update.groupId)?.adminKey
if (adminKey != null) {
groupScope.launch(update.groupId, "Handle possible group removals") {
processPendingRemovalsForGroup(update.groupId, adminKey)
try {
processPendingRemovalsForGroup(update.groupId, adminKey)
} catch (ec: Exception) {
Log.e("RemoveGroupMemberHandler", "Error processing pending removals", ec)
}
}
}
}
}
}
private suspend fun processPendingRemovalsForGroup(
groupAccountId: AccountId,
adminKey: ByteArray

@ -79,8 +79,12 @@ class MarkReadReceiver : BroadcastReceiver() {
hashToDisappearAfterReadMessage(context, markedReadMessages)?.let { hashToMessages ->
GlobalScope.launch {
fetchUpdatedExpiriesAndScheduleDeletion(context, hashToMessages)
shortenExpiryOfDisappearingAfterRead(hashToMessages)
try {
fetchUpdatedExpiriesAndScheduleDeletion(context, hashToMessages)
shortenExpiryOfDisappearingAfterRead(hashToMessages)
} catch (e: Exception) {
Log.e(TAG, "Failed to fetch updated expiries and schedule deletion", e)
}
}
}
}

@ -45,6 +45,7 @@ import org.session.libsignal.protos.SignalServiceProtos
import org.session.libsignal.utilities.AccountId
import org.session.libsignal.utilities.Base64
import org.session.libsignal.utilities.IdPrefix
import org.session.libsignal.utilities.Log
import org.session.libsignal.utilities.Namespace
import org.session.libsignal.utilities.defaultRequiresAuth
import org.session.libsignal.utilities.hasNamespaces
@ -511,7 +512,11 @@ object MessageSender {
storage.markAsSyncing(timestamp, userPublicKey)
GlobalScope.launch {
sendToSnodeDestination(Destination.Contact(userPublicKey), message, true)
try {
sendToSnodeDestination(Destination.Contact(userPublicKey), message, true)
} catch (ec: Exception) {
Log.e("MessageSender", "Unable to send sync message", ec)
}
}
}
}

Loading…
Cancel
Save