Skip to content

feat: Added statusCodesToTreatAsSuccess (additive success set) to NewBatchWithFailedRequests and Preserving RequestId - #980

Open
Jeppe Mastrup Spanggaard (jeppesc11) wants to merge 3 commits into
microsoftgraph:mainfrom
jeppesc11:main
Open

feat: Added statusCodesToTreatAsSuccess (additive success set) to NewBatchWithFailedRequests and Preserving RequestId#980
Jeppe Mastrup Spanggaard (jeppesc11) wants to merge 3 commits into
microsoftgraph:mainfrom
jeppesc11:main

Conversation

@jeppesc11

@jeppesc11 Jeppe Mastrup Spanggaard (jeppesc11) commented Sep 27, 2025

Copy link
Copy Markdown

Changes proposed in this pull request

  • Preserving RequestId while using NewBatchWithFailedRequests
  • Added statusCodesToTreatAsSuccess (additive success set) to NewBatchWithFailedRequests
Microsoft Reviewers: Open in CodeFlow

@jeppesc11

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@ramsessanchez

Copy link
Copy Markdown
Contributor

Jeppe Mastrup Spanggaard (@jeppesc11) Can you provide reasons or issue reference for added context as to why we would want to maintain the same request id?

@jeppesc11

Jeppe Mastrup Spanggaard (jeppesc11) commented Dec 19, 2025

Copy link
Copy Markdown
Author

Ramses Sanchez-Hernandez (@ramsessanchez) I can see that I should have explained why - apologies.

The reason is that, for example, with “Get file content” you don’t get an ID back that you can use to correlate with your requests -only the batch request ID. So if some number of the 20 calls in the batch fail and I then retry, I no longer have a way to correlate request and response.

I have previously written a longer blog post about this exact issue.

The reason for statusCodesToTreatAsSuccess is, again, that with “Get File Content” about 9 out of 10 times I get a response code indicating Redirect or Found. That means these will, by default, be retried - even though it’s a valid status code for this scenario. The same applies to 404.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine with the changes made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants