Send: clean and update CHANGES

This commit is contained in:
ganfra 2021-03-09 18:18:28 +01:00
parent a0df20fcd2
commit 3c7a108940
8 changed files with 8 additions and 17 deletions

View file

@ -11,6 +11,7 @@ Improvements 🙌:
- PIP support for Jitsi call (#2418)
- Add tooltip for room quick actions
- Pre-share session keys when opening a room or start typing (#2771)
- Sending is now queuing by room and not uniquely to the session
Bugfix 🐛:
- Try to fix crash about UrlPreview (#2640)

View file

@ -371,5 +371,4 @@ internal abstract class SessionModule {
@Binds
abstract fun bindEventSenderProcessor(processor: EventSenderProcessorCoroutine): EventSenderProcessor
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 New Vector Ltd
* Copyright 2021 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -33,5 +33,4 @@ internal interface EventSenderProcessor: SessionLifecycleObserver {
fun postTask(task: QueuedTask): Cancelable
fun cancel(eventId: String, roomId: String)
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 New Vector Ltd
* Copyright 2021 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -34,7 +34,6 @@ import org.matrix.android.sdk.internal.task.TaskExecutor
import org.matrix.android.sdk.internal.util.toCancelable
import timber.log.Timber
import java.io.IOException
import java.util.Queue
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicBoolean
import javax.inject.Inject
@ -57,7 +56,7 @@ internal class EventSenderProcessorCoroutine @Inject constructor(
private val sessionParams: SessionParams,
private val queuedTaskFactory: QueuedTaskFactory,
private val taskExecutor: TaskExecutor,
private val memento: QueueMemento,
private val memento: QueueMemento
) : EventSenderProcessor {
private val waitForNetworkSequencer = SemaphoreCoroutineSequencer()
@ -165,7 +164,7 @@ internal class EventSenderProcessorCoroutine @Inject constructor(
markAsFinished(task)
}
private suspend fun QueuedTask.markAsFailedOrRetry(failure: Throwable, retryDelay: Long){
private suspend fun QueuedTask.markAsFailedOrRetry(failure: Throwable, retryDelay: Long) {
if (retryCount.incrementAndGet() >= MAX_RETRY_COUNT) {
onTaskFailed()
} else {

View file

@ -33,9 +33,6 @@ import org.matrix.android.sdk.internal.session.SessionScope
import org.matrix.android.sdk.internal.task.TaskExecutor
import timber.log.Timber
import java.io.IOException
import java.net.InetAddress
import java.net.InetSocketAddress
import java.net.Socket
import java.util.Timer
import java.util.TimerTask
import java.util.concurrent.LinkedBlockingQueue
@ -74,7 +71,6 @@ internal class EventSenderProcessorThread @Inject constructor(
interrupt()
}
override fun start() {
super.start()
// We should check for sending events not handled because app was killed
@ -234,5 +230,4 @@ internal class EventSenderProcessorThread @Inject constructor(
}
synchronized(networkAvailableLock) { networkAvailableLock.wait() }
}
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021 New Vector Ltd
* Copyright 2021 The Matrix.org Foundation C.I.C.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -41,5 +41,4 @@ internal class HomeServerAvailabilityChecker(val sessionParams: SessionParams) {
return false
}
}
}

View file

@ -54,8 +54,7 @@ internal class QueueMemento @Inject constructor(context: Context,
persist()
}
fun trackedTasks() = synchronized(trackedTasks){
fun trackedTasks() = synchronized(trackedTasks) {
}
private fun persist() {

View file

@ -29,7 +29,7 @@ internal abstract class QueuedTask(
val taskIdentifier: String
) : Cancelable {
override fun toString() = "${javaClass.simpleName} queueIdentifier: $queueIdentifier, taskIdentifier: ${taskIdentifier})"
override fun toString() = "${javaClass.simpleName} queueIdentifier: $queueIdentifier, taskIdentifier: $taskIdentifier)"
var retryCount = AtomicInteger(0)