From 6743dc6273dc2a3d5f05e7a0a8f9ab9bb4834071 Mon Sep 17 00:00:00 2001 From: Valere Date: Sat, 22 Jun 2019 12:23:30 +0200 Subject: [PATCH] Set sync timeout to 30s when in foreground --- docs/notifications.md | 2 +- .../matrix/android/internal/session/sync/job/SyncThread.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/notifications.md b/docs/notifications.md index 5f68d07f..ad8a1c84 100644 --- a/docs/notifications.md +++ b/docs/notifications.md @@ -50,7 +50,7 @@ By default, this is 0, so the server will return immediately even if the respons **delay** is a client preference. When the server responds to a sync request, the client waits for `delay`before calling a new sync. -When the Riot X Android app is open (i.e in foreground state), the default timeout is 10 seconds, and delay is 0. +When the Riot X Android app is open (i.e in foreground state), the default timeout is 30 seconds, and delay is 0. ## How does a mobile app receives push notification diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt index 68d01d34..abb27a8a 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt @@ -37,7 +37,7 @@ import java.net.SocketTimeoutException import java.util.concurrent.CountDownLatch private const val RETRY_WAIT_TIME_MS = 10_000L -private const val DEFAULT_LONG_POOL_TIMEOUT = 10_000L +private const val DEFAULT_LONG_POOL_TIMEOUT = 30_000L private const val DEFAULT_LONG_POOL_DELAY = 0L internal class SyncThread(private val syncTask: SyncTask,