mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-07 03:44:31 +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 {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
debuggable true
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
|
@ -549,15 +549,8 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
|
|||||||
|
|
||||||
for (groupInfo in communities) {
|
for (groupInfo in communities) {
|
||||||
val groupBaseCommunity = groupInfo.community
|
val groupBaseCommunity = groupInfo.community
|
||||||
if (groupBaseCommunity.fullUrl() !in existingJoinUrls) {
|
if (groupBaseCommunity.fullUrl() in existingJoinUrls) {
|
||||||
// add it
|
// 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() }
|
val (threadId, _) = existingCommunities.entries.first { (_, v) -> v.joinURL == groupInfo.community.fullUrl() }
|
||||||
threadDb.setPinned(threadId, groupInfo.priority == PRIORITY_PINNED)
|
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) {
|
override suspend fun execute(dispatcherName: String) {
|
||||||
|
val delegate = delegate ?: return
|
||||||
val context = MessagingModuleConfiguration.shared.context
|
val context = MessagingModuleConfiguration.shared.context
|
||||||
val storage = MessagingModuleConfiguration.shared.storage
|
val storage = MessagingModuleConfiguration.shared.storage
|
||||||
val recipient = Recipient.from(context, recipientAddress, true)
|
val recipient = Recipient.from(context, recipientAddress, true)
|
||||||
val profileKey = recipient.resolve().profileKey
|
val profileKey = recipient.resolve().profileKey
|
||||||
|
|
||||||
if (profileKey == null || (profileKey.size != 32 && profileKey.size != 16)) {
|
if (profileKey == null || (profileKey.size != 32 && profileKey.size != 16)) {
|
||||||
Log.w(TAG, "Recipient profile key is gone!")
|
return delegate.handleJobFailedPermanently(this, dispatcherName, Exception("Recipient profile key is gone!"))
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit '78d1e9d' (fix: open group threads and avatar downloads) had this commented out so
|
// 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)
|
storage.setProfileAvatar(recipient, profileAvatar)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("Loki", "Failed to download profile avatar", e)
|
Log.e("Loki", "Failed to download profile avatar", e)
|
||||||
|
return delegate.handleJobFailedPermanently(this, dispatcherName, e)
|
||||||
} finally {
|
} finally {
|
||||||
downloadDestination.delete()
|
downloadDestination.delete()
|
||||||
}
|
}
|
||||||
|
return delegate.handleJobSucceeded(this, dispatcherName)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun serialize(): Data {
|
override fun serialize(): Data {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user