You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regression. ODL Client 8.2.3 fails to generate batch request.
Assemblies affected
OData .Net Client lib 8.2.3
Reproduce steps
Adding a new entity object to an existing tracked object's collection navigation properties and calling SaveChanges with BatchWithSingleChangeset now fails where as it used to (in ODL 8.2.2 and earlier) to correctly construct the $batch request with the one single change in it.
Despite the fact that the "reference" Trip/Pin service is buggy (and fails for the batch request on 8.2.2), you can use the following code to reproduce the issue...
var q = from p in ctx.People.Take(1)
select p;
var people = new DataServiceCollection<Person>(q);
var aFriend = new Person();
people.First().Friends.Add(aFriend);
aFriend.UserName = Guid.NewGuid().ToString();
aFriend.FirstName = "Test Friend";
aFriend.LastName = "Test Friend";
ctx.SaveChanges(SaveChangesOptions.BatchWithSingleChangeset | SaveChangesOptions.PostOnlySetProperties);
Expected result
You get the $batch request generated and sent to the service like on ODL 8.2.2.
Unhandled exception. Microsoft.OData.ODataException: The dependsOn Id: [1] in request [3] is not matching any of the request Id and atomic group Id seen so far. Forward reference is not allowed.
at Microsoft.OData.MultipartMixed.ODataMultipartMixedBatchWriter.ValidateDependsOnIds(String contentId, IEnumerable1 dependsOnIds) at Microsoft.OData.ODataBatchWriter.BuildOperationRequestMessage(Stream outputStream, String method, Uri uri, String contentId, String groupId, IEnumerable1 dependsOnIds)
at Microsoft.OData.MultipartMixed.ODataMultipartMixedBatchWriter.CreateOperationRequestMessageImplementation(String method, Uri uri, String contentId, BatchPayloadUriOption payloadUriOption, IEnumerable1 dependsOnIds) at Microsoft.OData.ODataBatchWriter.CreateOperationRequestMessageInternal(String method, Uri uri, String contentId, BatchPayloadUriOption payloadUriOption, IEnumerable1 dependsOnIds)
at Microsoft.OData.ODataBatchWriter.CreateOperationRequestMessage(String method, Uri uri, String contentId, BatchPayloadUriOption payloadUriOption, IEnumerable`1 dependsOnIds)
at Microsoft.OData.Client.ODataRequestMessageWrapper.CreateBatchPartRequestMessage(ODataBatchWriter batchWriter, BuildingRequestEventArgs requestMessageArgs, RequestInfo requestInfo, String contentId, Boolean isRelativeUri)
at Microsoft.OData.Client.BatchSaveResult.CreateRequestMessage(String method, Uri requestUri, HeaderCollection headers, HttpStack httpStack, Descriptor descriptor, String contentId)
at Microsoft.OData.Client.BaseSaveResult.CreateRequest(EntityDescriptor entityDescriptor)
at Microsoft.OData.Client.BatchSaveResult.GenerateBatchRequest()
at Microsoft.OData.Client.BatchSaveResult.BatchRequest()
at Microsoft.OData.Client.DataServiceContext.SaveChanges(SaveChangesOptions options)
at ReferenceService.Program.Main(String[] args) in C:\Users\Z6UFE\Source\Repos\ReferenceService\Program.cs:line 23
Additional detail
Optional, details of the root cause if known. Delete this section if you have no additional details to add.
The text was updated successfully, but these errors were encountered:
Regression. ODL Client 8.2.3 fails to generate batch request.
Assemblies affected
OData .Net Client lib 8.2.3
Reproduce steps
Adding a new entity object to an existing tracked object's collection navigation properties and calling SaveChanges with BatchWithSingleChangeset now fails where as it used to (in ODL 8.2.2 and earlier) to correctly construct the $batch request with the one single change in it.
Despite the fact that the "reference" Trip/Pin service is buggy (and fails for the batch request on 8.2.2), you can use the following code to reproduce the issue...
Expected result
You get the $batch request generated and sent to the service like on ODL 8.2.2.
Actual result
You get an exception on ODL 8.2.3:
Unhandled exception. Microsoft.OData.ODataException: The dependsOn Id: [1] in request [3] is not matching any of the request Id and atomic group Id seen so far. Forward reference is not allowed.
at Microsoft.OData.MultipartMixed.ODataMultipartMixedBatchWriter.ValidateDependsOnIds(String contentId, IEnumerable
1 dependsOnIds) at Microsoft.OData.ODataBatchWriter.BuildOperationRequestMessage(Stream outputStream, String method, Uri uri, String contentId, String groupId, IEnumerable
1 dependsOnIds)at Microsoft.OData.MultipartMixed.ODataMultipartMixedBatchWriter.CreateOperationRequestMessageImplementation(String method, Uri uri, String contentId, BatchPayloadUriOption payloadUriOption, IEnumerable
1 dependsOnIds) at Microsoft.OData.ODataBatchWriter.CreateOperationRequestMessageInternal(String method, Uri uri, String contentId, BatchPayloadUriOption payloadUriOption, IEnumerable
1 dependsOnIds)at Microsoft.OData.ODataBatchWriter.CreateOperationRequestMessage(String method, Uri uri, String contentId, BatchPayloadUriOption payloadUriOption, IEnumerable`1 dependsOnIds)
at Microsoft.OData.Client.ODataRequestMessageWrapper.CreateBatchPartRequestMessage(ODataBatchWriter batchWriter, BuildingRequestEventArgs requestMessageArgs, RequestInfo requestInfo, String contentId, Boolean isRelativeUri)
at Microsoft.OData.Client.BatchSaveResult.CreateRequestMessage(String method, Uri requestUri, HeaderCollection headers, HttpStack httpStack, Descriptor descriptor, String contentId)
at Microsoft.OData.Client.BaseSaveResult.CreateRequest(EntityDescriptor entityDescriptor)
at Microsoft.OData.Client.BatchSaveResult.GenerateBatchRequest()
at Microsoft.OData.Client.BatchSaveResult.BatchRequest()
at Microsoft.OData.Client.DataServiceContext.SaveChanges(SaveChangesOptions options)
at ReferenceService.Program.Main(String[] args) in C:\Users\Z6UFE\Source\Repos\ReferenceService\Program.cs:line 23
Additional detail
Optional, details of the root cause if known. Delete this section if you have no additional details to add.
The text was updated successfully, but these errors were encountered: