wordpress-mobile / wordpress-mobile/WordPress-iOS
Media / Async: Network failures during iCloud fetch aren't recoverable
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 3.9k
- Forks
- 1.2k
- Avg merge
- 23h 51m
- Merged PRs (30d)
- 58
Description
I'm not entirely sure if this is fixable or not...
Expected behavior
If my post fails to upload, I expect to be able to tap Retry and for it to upload again successfully.
Actual behavior
If there is a network failure or other error when fetching media from a user's iCloud library, attempts to retry the upload always fail.
Steps to reproduce the behavior
- Start a new post, and add media that is in the user's iCloud Photos library, but not on device.
- Before the media finishes processing, publish async and then turn on airplane mode.
- The post will fail for the following reason:
2018-04-05 09:47:03:409 WordPress[5788:814178] Error occurred importing to Media with system error, code: 81, error: Error Domain=CloudPhotoLibraryErrorDomain Code=81 "Failed to download CPLResourceTypeOriginal" UserInfo={NSLocalizedDescription=Failed to download CPLResourceTypeOriginal, NSUnderlyingError=0x1c265d100 {Error Domain=CKErrorDomain Code=3 "(null)" UserInfo={NSUnderlyingError=0x1c2840510 {Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={NSLocalizedDescription=The Internet connection appears to be offline.}}}}}
- If you switch off airplane mode and attempt to retry the upload of the failed post, it will always fail for the following reason:
2018-04-05 10:19:16:891 WordPress[5954:830625] Error uploading media: Error Domain=MediaServiceErrorDomain Code=0 "Media doesn't have an associated file to upload." UserInfo={NSLocalizedDescription=Media doesn't have an associated file to upload.}
Tested on iPad Pro 9.7", iOS 11.3, WPiOS develop (9.7 / 9.8)
cc @SergioEstevao
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the async publish flow with media stored only in the user's iCloud Photos library, then compare the initial failure with a retry after connectivity returns. Trace the iCloud media fetch and failed-post retry paths described in the report. Done means a network failure during fetching does not leave the media without an associated file, and Retry can upload the post successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100