mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 20:45:17 +00:00
build: trying to track down broken retrieve avatar job
This commit is contained in:
parent
05f8dc6d43
commit
8d0f946791
@ -240,6 +240,7 @@ android {
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
debuggable true
|
||||
minifyEnabled false
|
||||
}
|
||||
debug {
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user