diff --git a/app/build.gradle b/app/build.gradle index 21dbf9f5d2..f9d6aee31b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -240,6 +240,7 @@ android { buildTypes { release { + debuggable true minifyEnabled false } debug { diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt index be2dd0c71b..b99ba34ab2 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt @@ -549,15 +549,8 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co for (groupInfo in communities) { val groupBaseCommunity = groupInfo.community - if (groupBaseCommunity.fullUrl() !in existingJoinUrls) { + if (groupBaseCommunity.fullUrl() in existingJoinUrls) { // add it - try { - val (threadId, _) = OpenGroupManager.add(groupBaseCommunity.baseUrl, groupBaseCommunity.room, groupBaseCommunity.pubKeyHex, context) - threadDb.setPinned(threadId, groupInfo.priority == PRIORITY_PINNED) - } catch (e: Exception) { - Log.e("Loki", "Failed to get Open Group Info on syncing config",e) - } - } else { val (threadId, _) = existingCommunities.entries.first { (_, v) -> v.joinURL == groupInfo.community.fullUrl() } threadDb.setPinned(threadId, groupInfo.priority == PRIORITY_PINNED) } diff --git a/libsession/src/main/java/org/session/libsession/messaging/jobs/RetrieveProfileAvatarJob.kt b/libsession/src/main/java/org/session/libsession/messaging/jobs/RetrieveProfileAvatarJob.kt index a29087d7c9..d4296a82d7 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/jobs/RetrieveProfileAvatarJob.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/jobs/RetrieveProfileAvatarJob.kt @@ -34,14 +34,14 @@ class RetrieveProfileAvatarJob(private val profileAvatar: String?, val recipient } override suspend fun execute(dispatcherName: String) { + val delegate = delegate ?: return val context = MessagingModuleConfiguration.shared.context val storage = MessagingModuleConfiguration.shared.storage val recipient = Recipient.from(context, recipientAddress, true) val profileKey = recipient.resolve().profileKey if (profileKey == null || (profileKey.size != 32 && profileKey.size != 16)) { - Log.w(TAG, "Recipient profile key is gone!") - return + return delegate.handleJobFailedPermanently(this, dispatcherName, Exception("Recipient profile key is gone!")) } // Commit '78d1e9d' (fix: open group threads and avatar downloads) had this commented out so @@ -85,9 +85,11 @@ class RetrieveProfileAvatarJob(private val profileAvatar: String?, val recipient storage.setProfileAvatar(recipient, profileAvatar) } catch (e: Exception) { Log.e("Loki", "Failed to download profile avatar", e) + return delegate.handleJobFailedPermanently(this, dispatcherName, e) } finally { downloadDestination.delete() } + return delegate.handleJobSucceeded(this, dispatcherName) } override fun serialize(): Data {