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) - PIP support for Jitsi call (#2418)
- Add tooltip for room quick actions - Add tooltip for room quick actions
- Pre-share session keys when opening a room or start typing (#2771) - 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 🐛: Bugfix 🐛:
- Try to fix crash about UrlPreview (#2640) - Try to fix crash about UrlPreview (#2640)

View File

@ -371,5 +371,4 @@ internal abstract class SessionModule {
@Binds @Binds
abstract fun bindEventSenderProcessor(processor: EventSenderProcessorCoroutine): EventSenderProcessor 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 postTask(task: QueuedTask): Cancelable
fun cancel(eventId: String, roomId: String) 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 org.matrix.android.sdk.internal.util.toCancelable
import timber.log.Timber import timber.log.Timber
import java.io.IOException import java.io.IOException
import java.util.Queue
import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.atomic.AtomicBoolean import java.util.concurrent.atomic.AtomicBoolean
import javax.inject.Inject import javax.inject.Inject
@ -57,7 +56,7 @@ internal class EventSenderProcessorCoroutine @Inject constructor(
private val sessionParams: SessionParams, private val sessionParams: SessionParams,
private val queuedTaskFactory: QueuedTaskFactory, private val queuedTaskFactory: QueuedTaskFactory,
private val taskExecutor: TaskExecutor, private val taskExecutor: TaskExecutor,
private val memento: QueueMemento, private val memento: QueueMemento
) : EventSenderProcessor { ) : EventSenderProcessor {
private val waitForNetworkSequencer = SemaphoreCoroutineSequencer() private val waitForNetworkSequencer = SemaphoreCoroutineSequencer()
@ -165,7 +164,7 @@ internal class EventSenderProcessorCoroutine @Inject constructor(
markAsFinished(task) 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) { if (retryCount.incrementAndGet() >= MAX_RETRY_COUNT) {
onTaskFailed() onTaskFailed()
} else { } else {

View File

@ -33,9 +33,6 @@ import org.matrix.android.sdk.internal.session.SessionScope
import org.matrix.android.sdk.internal.task.TaskExecutor import org.matrix.android.sdk.internal.task.TaskExecutor
import timber.log.Timber import timber.log.Timber
import java.io.IOException import java.io.IOException
import java.net.InetAddress
import java.net.InetSocketAddress
import java.net.Socket
import java.util.Timer import java.util.Timer
import java.util.TimerTask import java.util.TimerTask
import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.LinkedBlockingQueue
@ -74,7 +71,6 @@ internal class EventSenderProcessorThread @Inject constructor(
interrupt() interrupt()
} }
override fun start() { override fun start() {
super.start() super.start()
// We should check for sending events not handled because app was killed // 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() } 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 return false
} }
} }
} }

View File

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

View File

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