Delay after-execution-sync for Outlook only.
This commit is contained in:
@@ -149,7 +149,11 @@ namespace Wino.Core.Synchronizers
|
|||||||
await synchronizationSemaphore.WaitAsync(activeSynchronizationCancellationToken);
|
await synchronizationSemaphore.WaitAsync(activeSynchronizationCancellationToken);
|
||||||
|
|
||||||
// Let servers to finish their job. Sometimes the servers doesn't respond immediately.
|
// 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);
|
await Task.Delay(2000);
|
||||||
}
|
}
|
||||||
@@ -311,6 +315,7 @@ namespace Wino.Core.Synchronizers
|
|||||||
return options;
|
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>> 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>> 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()));
|
public virtual IEnumerable<IRequestBundle<TBaseRequest>> MarkRead(BatchMarkReadRequest request) => throw new NotSupportedException(string.Format(Translator.Exception_UnsupportedSynchronizerOperation, this.GetType()));
|
||||||
|
|||||||
@@ -406,6 +406,8 @@ namespace Wino.Core.Synchronizers
|
|||||||
|
|
||||||
#region Mail Integration
|
#region Mail Integration
|
||||||
|
|
||||||
|
public override bool DelaySendOperationSynchronization() => true;
|
||||||
|
|
||||||
public override IEnumerable<IRequestBundle<RequestInformation>> Move(BatchMoveRequest request)
|
public override IEnumerable<IRequestBundle<RequestInformation>> Move(BatchMoveRequest request)
|
||||||
{
|
{
|
||||||
var requestBody = new Microsoft.Graph.Me.Messages.Item.Move.MovePostRequestBody()
|
var requestBody = new Microsoft.Graph.Me.Messages.Item.Move.MovePostRequestBody()
|
||||||
|
|||||||
Reference in New Issue
Block a user