Currently trying to POST a chunk with the same index as an already uploaded chunk for a given batch file throws a NuxeoException with the following message: "Cannot add chunk with index i to file entry XXX as it already exists."
We should allow to overwrite the existing chunk.
This would make the upload endpoint:
- More resilient in case of parallel chunks upload.
- Idempotent in this case. In fact maybe we should be using PUT instead of POST here?
We could check if the chunk being uploaded has the same digest as the existing one and only allow the overwrite in this case.
This would require storing the blob's digest in the TransientStore which is currently not the case.