diff --git a/app/src/main/java/org/thoughtcrime/securesms/groups/OpenGroupManager.kt b/app/src/main/java/org/thoughtcrime/securesms/groups/OpenGroupManager.kt index 06d9f05e25..1f27a36c2f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/groups/OpenGroupManager.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/groups/OpenGroupManager.kt @@ -104,7 +104,7 @@ object OpenGroupManager { val storage = MessagingModuleConfiguration.shared.storage val configFactory = MessagingModuleConfiguration.shared.configFactory val threadDB = DatabaseComponent.get(context).threadDatabase() - val openGroupID = "$server.$room" + val openGroupID = "${server.removeSuffix("/")}.$room" val threadID = GroupManager.getOpenGroupThreadID(openGroupID, context) val recipient = threadDB.getRecipientForThreadId(threadID) ?: return threadDB.setThreadArchived(threadID) diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/ConfigurationMessageUtilities.kt b/app/src/main/java/org/thoughtcrime/securesms/util/ConfigurationMessageUtilities.kt index e2121f4d3a..ca74da5548 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/ConfigurationMessageUtilities.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/util/ConfigurationMessageUtilities.kt @@ -74,10 +74,12 @@ object ConfigurationMessageUtilities { if (ConfigBase.isNewConfigEnabled) { // schedule job if none exist // don't schedule job if we already have one + Log.d("Loki-DBG", "Forcing config sync") val ourDestination = Destination.Contact(userPublicKey) val currentStorageJob = storage.getConfigSyncJob(ourDestination) if (currentStorageJob != null) { (currentStorageJob as ConfigurationSyncJob).shouldRunAgain.set(true) + Log.d("Loki-DBG", "Not scheduling another one") return Promise.ofFail(NullPointerException("A job is already pending or in progress, don't schedule another job")) } val newConfigSync = ConfigurationSyncJob(ourDestination) diff --git a/libsession/src/main/java/org/session/libsession/messaging/jobs/GroupAvatarDownloadJob.kt b/libsession/src/main/java/org/session/libsession/messaging/jobs/GroupAvatarDownloadJob.kt index 9571f44e76..476798ff5e 100644 --- a/libsession/src/main/java/org/session/libsession/messaging/jobs/GroupAvatarDownloadJob.kt +++ b/libsession/src/main/java/org/session/libsession/messaging/jobs/GroupAvatarDownloadJob.kt @@ -18,7 +18,12 @@ class GroupAvatarDownloadJob(val server: String, val room: String, val imageId: return } val storage = MessagingModuleConfiguration.shared.storage - val storedImageId = storage.getOpenGroup(room, server)?.imageId + val openGroup = storage.getOpenGroup(room, server) + if (openGroup == null) { + delegate?.handleJobFailedPermanently(this, dispatcherName, Exception("GroupAvatarDownloadJob openGroup is null")) + return + } + val storedImageId = openGroup.imageId if (storedImageId == null || storedImageId != imageId) { delegate?.handleJobFailedPermanently(this, dispatcherName, Exception("GroupAvatarDownloadJob imageId does not match the OpenGroup"))