wordpress-mobile / WordPress-iOS

WordPress for iOS - Official repository
http://ios.wordpress.org/
GNU General Public License v2.0
3.68k stars 1.11k forks source link

Validate site icon URL #23579

Closed crazytonyli closed 4 weeks ago

crazytonyli commented 4 weeks ago

I noticed there are many errors like this when navigating to the Reader.

Task <FF11E022-6F86-42FA-8041-1208EF01A307>.<10> finished with error [-1002] Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSErrorFailingURLStringKey=?d=404&s=80, NSErrorFailingURLKey=?d=404&s=80, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <FF11E022-6F86-42FA-8041-1208EF01A307>.<10>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <FF11E022-6F86-42FA-8041-1208EF01A307>.<10>, NSUnderlyingError=0x353ffa600 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}

The cause is URLSession fetches an incorrect URL ?d=404&s=80. It turns out some site icon urls are malformed.

The root cause is that readerSiteTopic.siteBlavatar is an empty string, which is used as a full URL path to construct a URL, which ends up to be ?d=404&s=80.

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

Testing checklist:

wpmobilebot commented 4 weeks ago
WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr23579-097ebc2
Version25.3
Bundle IDorg.wordpress.alpha
Commit097ebc2593e4a94cc12dc1922f4e51c426458434
App Center BuildWPiOS - One-Offs #10630
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.
wpmobilebot commented 4 weeks ago
Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr23579-097ebc2
Version25.3
Bundle IDcom.jetpack.alpha
Commit097ebc2593e4a94cc12dc1922f4e51c426458434
App Center Buildjetpack-installable-builds #9673
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.