Skip to content

Request().WithShouldRetry is not called for failed requests. #190

Description

@spmanjunath

Expected behavior

i am trying to overcome intermittent 409 error that occurs while uploading/updating metadata of a file in SharePoint's Document library using Microsoft Graph SDK. To retry failed calls SDK provides WithMaxRetry() and WithShouldRetry() options. The MaxRetry works for error codes 429, and I am assuming that ShouldRetry delegate offers us an option to implement our own evaluation logic for the retries. Based on this assumption, I have the below code:

_graphServiceClientFactory.GetClient().Drives[driveId].Root.ItemWithPath(path).ListItem.Fields.Request()
                       .WithShouldRetry((delay, attempt, httpResponse) =>
                        (attempt <= 5 &&
                        (httpResponse.StatusCode == HttpStatusCode.Conflict)))
                       .UpdateAsync(new FieldValueSet { AdditionalData = dataDictionary });

Actual behavior

In my test the ShouldRetry delegate is never evaluated on failed requests. I am not sure if the above usage is correct (i could not find any reference of its usage), please suggest otherwise.

Thanks.
AB#7188

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions