Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On batch changeset, include the content ids, status codes, and response bodies in the result #124

Merged
merged 4 commits into from
Jun 1, 2021

Conversation

bprucha
Copy link
Contributor

@bprucha bprucha commented May 30, 2021

On batch changeset, include the content ids, status codes, and response bodies in the result. These are important pieces of information for processing batch changeset responses. It also standardizes the response format rather than having different data types, one for just status code when no body is provided and another with the response body but no status code.

Also fix bug on batch error where response JSON body not included in the exception. In the try block {res, error} is being thrown which is immediately being caught in the catch block which throws only res so the error JSON body gets lost.

Brett Prucha added 2 commits May 29, 2021 23:09
…cluded in the exception

On batch changeset, include the content ids, status codes, and response bodies in the result
@janhommes
Copy link
Owner

@bprucha thanks for contributing. I am willing to accept this, but can you merge my latest changes to fix the tests? Also, we might need a test for this (to make it more clear) as of now, I don't understand it fully (lately not working that much with odata and batch request at all.

@bprucha
Copy link
Contributor Author

bprucha commented May 31, 2021

@janhommes I'd be happy to make a test case but not sure of a public .NET WebAPI OData service that I can use for the tests. The services.odata.org implementation is based off of Restier which behaves differently. In the Microsoft implementation, when an individual operation in a batch change set fails, the response status is 200 with the body being a batch response including the content id of which operation failed. That allows you to determine of all the operations that were sent, which of them triggered the actual error. The Restier implementation sends an error response status with the body being a generic OData error. It's not a batch response body so it leaves you guessing as to which one of the batch operations actually triggered the error.

@bprucha
Copy link
Contributor Author

bprucha commented May 31, 2021

To be clear I'm referring to the Microsoft implementation of the .NET WebAPI OData service:

@bprucha bprucha closed this May 31, 2021
@bprucha bprucha reopened this May 31, 2021
@janhommes janhommes merged commit 9f70115 into janhommes:master Jun 1, 2021
@janhommes
Copy link
Owner

@bprucha yeah this is an issue we are having for quite a while (see issue #64). The unit test might spin up an own server for verifying. But that is quite a huge task. Let's keep the test so long simple and track it in the ticket.

Will trigger a release soon. Thanks for contributing. If you like you can update the package.json and add your name there.

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.

2 participants