WKWebView left in unrecoverable state after network error

Originator:cpickslay
Number:rdar://21334711 Date Originated:6/10/15
Status:Open Resolved:
Product:iOS SDK Product Version:8+
Classification:Serious Bug Reproducible:Always
 
Summary:
If a WKWebView fails to load due to a network error, its URL property is nilled out, so you can't call reload to try again. It's possible to track the URL in a separate state and pass it to loadRequest(), but that is messy as you must update that state variable as the user navigates in the web view.

It seems unnecessary to nil out the URL field in the event of a network failure.

Steps to Reproduce:
1. Open the attached project in Xcode 6.3
2. Disable the network interface
3. Compile and run the project. An alert is displayed after the network request fails.
4. Re-enable the network interface
5. Tap the Reload button in the alert

Expected Results:
The web view should load the requested URL

Actual Results:
The web view is blank

Version:
iOS 8+

Notes:
Note the attached project is named WKWebViewCrash only because I'm using it to reproduce a similar bug when the web process crashes. The current bug is not a crashing bug.

Configuration:
Mac running Yosemite and iPhone Simulator 8+ or iPhone running iOS 8+

Attachments:
'WKWebViewCrash.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!