I want to report a issue on PHAssetChangeRequest.deleteAssets
Environment
iOS 18.5, iOS 26.2.5, iOS 27.0
Steps to Reproduce
- Capture a 48MP ProRAW (DNG) photo with the Camera app.
- Open my app, call the following api to delete this photo:
PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.deleteAssets(assets)
}, completionHandler: completionHandler)
Expected
The system delete-confirmation dialog appears; after the user confirms, the asset is deleted and the completionHandler is called or report error if it failed
Actual
Sometime the following issue happens:
- The confirmation dialog never appears and the completionHandler is never called
- no success, no error, no timeout.
- The built-in Photos app can delete the affected asset but API can't.
- The stuck request leaks permanently. Even after the same asset is subsequently deleted via the built-in Photos app, the pending completionHandler is still never invoked.
Workaround for this issue
When the issue happens, restarting the iPhone or reinstall app can not help to fix it
But I found if I leave the device alone for an extended period (maybe 10 min~1 hour) and restart the iPhone, finally I found PHAssetChangeRequest.deleteAssets work again.
It looks like some background task for 48MP RAW image in DNG format stuck delete API. I need to wait the task finished and restart device to reset stuck status. But I can not know when the DNG is ready to delete, it looks like my app hangs
I think the better behavior is completion block should return a error to tell user what happens instead of not calling completion block.