Delay after-execution-sync for Outlook only.

This commit is contained in:
Burak Kaan Köse
2024-06-12 02:12:39 +02:00
parent fdea15eef4
commit 4c080360a7
2 changed files with 8 additions and 1 deletions

View File

@@ -149,7 +149,11 @@ namespace Wino.Core.Synchronizers
await synchronizationSemaphore.WaitAsync(activeSynchronizationCancellationToken);
// Let servers to finish their job. Sometimes the servers doesn't respond immediately.
if (options.Type == SynchronizationType.ExecuteRequests)
// TODO: Outlook sends back the deleted Draft. Might be a bug in the graph API or in Wino.
var hasSendDraftRequest = batches.Any(a => a is BatchSendDraftRequestRequest);
if (hasSendDraftRequest && DelaySendOperationSynchronization())
{
await Task.Delay(2000);
}
@@ -311,6 +315,7 @@ namespace Wino.Core.Synchronizers
return options;
}
public virtual bool DelaySendOperationSynchronization() => false;
public virtual IEnumerable<IRequestBundle<TBaseRequest>> Move(BatchMoveRequest request) => throw new NotSupportedException(string.Format(Translator.Exception_UnsupportedSynchronizerOperation, this.GetType()));
public virtual IEnumerable<IRequestBundle<TBaseRequest>> ChangeFlag(BatchChangeFlagRequest request) => throw new NotSupportedException(string.Format(Translator.Exception_UnsupportedSynchronizerOperation, this.GetType()));
public virtual IEnumerable<IRequestBundle<TBaseRequest>> MarkRead(BatchMarkReadRequest request) => throw new NotSupportedException(string.Format(Translator.Exception_UnsupportedSynchronizerOperation, this.GetType()));

View File

@@ -406,6 +406,8 @@ namespace Wino.Core.Synchronizers
#region Mail Integration
public override bool DelaySendOperationSynchronization() => true;
public override IEnumerable<IRequestBundle<RequestInformation>> Move(BatchMoveRequest request)
{
var requestBody = new Microsoft.Graph.Me.Messages.Item.Move.MovePostRequestBody()