Make sure the requests are reflected to UI during synchronization.

This commit is contained in:
Burak Kaan Köse
2025-03-19 23:37:50 +01:00
parent 13b495b0f6
commit c6048aea80

View File

@@ -97,10 +97,6 @@ public abstract class WinoSynchronizer<TBaseRequest, TMessageType, TCalendarEven
PendingSynchronizationRequest.Add(options, newCancellationTokenSource);
activeSynchronizationCancellationToken = newCancellationTokenSource.Token;
await synchronizationSemaphore.WaitAsync(activeSynchronizationCancellationToken);
PublishSynchronizationProgress(1);
// ImapSynchronizer will send this type when an Idle client receives a notification of changes.
// We should not execute requests in this case.
bool shouldExecuteRequests = options.Type != MailSynchronizationType.IMAPIdle;
@@ -207,6 +203,10 @@ public abstract class WinoSynchronizer<TBaseRequest, TMessageType, TCalendarEven
options.ExcludeMustHaveFolders = requestCopies.All(a => a is ICustomFolderSynchronizationRequest request && request.ExcludeMustHaveFolders);
}
await synchronizationSemaphore.WaitAsync(activeSynchronizationCancellationToken);
PublishSynchronizationProgress(1);
State = AccountSynchronizerState.Synchronizing;
// Handle special synchronization types.