Permanently Erroneous Photos
In some cases, when trying to upload a photo / video file to the cloud, errors occur that turn a file into a permanent error state. This status is internal. The Photos SDK no longer tries to autoload files with this status. A permanent error status can be assigned to a photo / video file in one of the following cases:
- The backend refuses to accept such a file for upload (for example, the photo or video format is not supported);
- The counter of attempts to upload a file to the cloud has exceeded the maximum specified value (see UploadConfig.maxRetryCount).
Use the following code example to reset the state of permanently erroneous files to their original state (ready to download).
important
It is recommended to call this function no more often than once when starting the application.
var disposable: Disposable? = null
// ...
// Returns completable, which completes when the operation ends.// You have to subscribe on returned observable in order to receive updates.disposable = PhotoManager.uploadManager.resetPermanentErroneousPhotos() .observeOn(AndroidSchedulers.mainThread()) .subscribeBy( onComplete = { // do something... }, onError = { // it: Throwable // do something... } )
// ...
// You must call dispose() on disposable that returned by subscribe() method,// when it no longer needed, for example in your fragment’s onStop() or onPause().disposable?.dispose()