Batch Request does not take dependsOn into account
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 481
- Forks
- 136
- PR merge metrics
- No merged PRs in 30d
Description
A batch request with 2 request, where the second request depends on the first. The first requests creates a new item and the second should create a new related item to the item from the first request, therefore the "$ContentId" url syntax is used.in the second request. Both requests are in the same atomicityGroup.
The Problem is that both request get executed in parallel, and the second request can' t replace the "$ContentId" in the url because the first request didn't finish yet.
Assemblies affected
Microsoft.Restier.AspNetCore 1.1.1
Reproduce steps
A batch request contains 2 request, where the second request depends on the first. The first requests creates a new item and the second should create a new related item to the item from the first request, therefore the "$1" url syntax is used. Both requests are in the same atomicityGroup.
The simplest set of steps to reproduce the issue. If possible, reference a commit that demonstrates the issue.
Expected result
The BatchChangeSetRequestItem should consider the dependsOn property of a request and order them correctly and execute only possible requests in parallel.
Actual result
Both requests are executed in parallel.
Additional details
For a small example see: https://docs.oasis-open.org/odata/odata-json-format/v4.01/odata-json-format-v4.01.html#sec_ReferencingNewEntities
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/Microsoft.Restier.AspNet/Batch/RestierBatchChangeSetRequestItem.cs around line 98, then compare the batch dependency behavior with the OData JSON format example for referencing new entities. Done means requests honor dependsOn ordering, while independent requests in the same atomicity group can still execute in parallel.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100