From ccd3956cb2d02e1d3c0cb0f3113fcedffe6bb4ce Mon Sep 17 00:00:00 2001 From: Konstantin Date: Sat, 8 Oct 2022 14:06:32 +0300 Subject: [PATCH] IsSyncing flag in PollingService now get in to True before HTTP sync happene --- Matrix.Sdk/Core/Domain/Services/PollingService.cs | 7 +++---- Matrix.Sdk/Matrix.Sdk.csproj | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Matrix.Sdk/Core/Domain/Services/PollingService.cs b/Matrix.Sdk/Core/Domain/Services/PollingService.cs index 6f388a5..fafe9d4 100644 --- a/Matrix.Sdk/Core/Domain/Services/PollingService.cs +++ b/Matrix.Sdk/Core/Domain/Services/PollingService.cs @@ -84,13 +84,12 @@ private async Task PollAsync() try { _pollingTimer!.Change(Timeout.Infinite, Timeout.Infinite); - + IsSyncing = true; + SyncResponse response = await _eventService.SyncAsync(_accessToken!, _cts.Token, _timeout, _nextBatch); - SyncBatch syncBatch = SyncBatch.Factory.CreateFromSync(response.NextBatch, response.Rooms); - - IsSyncing = true; + _nextBatch = syncBatch.NextBatch; _timeout = Constants.LaterSyncTimout; diff --git a/Matrix.Sdk/Matrix.Sdk.csproj b/Matrix.Sdk/Matrix.Sdk.csproj index 681d745..38a26f7 100644 --- a/Matrix.Sdk/Matrix.Sdk.csproj +++ b/Matrix.Sdk/Matrix.Sdk.csproj @@ -14,7 +14,7 @@ Mikhail Tatarenko Matrix.Sdk This open-source library allows you to build .NET apps compatible with Matrix Protocol - http://www.matrix.org. - 1.0.3 + 1.0.4 Copyright © Baking Bad 2019-2022 enable netstandard2.0