-
Notifications
You must be signed in to change notification settings - Fork 63
Description
Batching should make your application a lot faster, but the SDK has no way to check if all modifications are successful without checking each individual request.
I'm also the creator of #613 so I know a thing or two on batching. This new proposal needs addition input, because I'm not sure on the solution either.
Please provide the following (and please check them off the list with [x]) before submitting this issue:
- Expected behavior. Please provide links to the specific Microsoft Graph documentation you used to determine the expected behavior.
- Actual behavior. Provide error codes, stack information, and a Fiddler capture of the request and response (please remove personally identifiable information before posting).
- Steps to reproduce the behavior. Include your code, IDE versions, client library versions, and any other information that might be helpful to understand your scenario.
Expected behavior
If you added 15 items to a batch and it's executed I would expect there to be a way to check if all individual requests have a success response code (200, 202 or 204).
Something like:
var batchCollection = new BatchRequestContentCollection(graphClient);
foreach (var task in tasks)
{
await batchCollection.AddBatchRequestStepAsync(graphClient.Me.Todo.Lists[listId].Tasks.ToPostRequestInformation(task));
}
var result = await graphClient.Batch.PostAsync(batchCollection);
var success = await result.ValidateSuccess();And maybe even return the failed requests somehow for retry.
Actual behavior
var success = await result.ValidateSuccess(); is not available.
Steps to reproduce the behavior
Run this program and see the batch execute successfully, while individual requests not all succeed (16 of the 20 requests are blocked with a 429 error code).