I'm developing an application on strongloop which has multiple image uploads. I'm using loopback component-storage for uploading files using REST API. The containers are dynamic (client app sends unique container ids) and I'm creating folder for the container within 'beforeRemote' using the container id. Also I have some application logic inside 'afterRemote'. Recently I faced a strange issue that an image uploading under one container gets overridden from another image upload which happens under different container id. This was a rare issue which I came across only twice. beforeRemote method:
afterRemote method:
The conflict of images occurred during this sequence of steps. Images are more than 500 KB in size and image set contains 2 images.
Note: Client A is having poor internet connectivity and client B is having moderate level of internet connectivity. I re-checked the container ids sent by the client and they are unique. I tried to re-create this by following the same steps as above but failed. I'm wondering how the images got overridden by other uploads when uploading happens in parallel. I'm new to Strongloop and I really appreciate if anybody could give me a clue on the cause of this problem. Here are my versions:
|