Unable to add resource after setting shouldMoveFile to NO

Hello, Recently we added a change in our app that changed the resource addition to Photos - Until now we called addResourceWithType:fileURL:options: with PHAssetResourceCreationOptions.shouldMoveFile set to YES, and when we changed it to NO (the default value) we observed much more asset creation failures. Specifically we see a new error code in the procedure - PHPhotosErrorNotEnoughSpace. One can clearly see a connection between adding more storage to the file system and an asset creation failure that is related to storage, but we are struggling to understand a few things:

  1. The storage of the device is always higher than the video size, usually by a great amount - We observed failures for devices with 120GB free storage, while the video size was 200MB.
  2. Generally we save quite a lot of resources to the file system, so it is quite surprising to see supposedly storage issues when adding a relatively low amount of extra storage.
  3. The asset creation is part of a bigger procedure of encoding a video to a file system, and then moving/copying it to Photos. Is it that big of a difference to copy a video of 100MB-200MB instead of moving it, such that the overall procedure failure will increase drastically?

Appreciate any help.

Replies

Any insights? Another weird thing we see is that in cases there is a storage problem in the device, the procedure stops in the file encoding to the file system, much before the resource addition (AVFoundation warns on insufficient storage). This seems to strengthen the direction that it isn't really a device storage issue, maybe it is some storage spike that an app cannot surpass?