meteor / cordova-plugin-meteor-webapp

Cordova plugin that serves a Meteor web app through a local server and implements hot code push
MIT License
66 stars 74 forks source link

iOS 14: network retry when prompting for local network access #99

Open hexsprite opened 3 years ago

hexsprite commented 3 years ago

iOS 14 has introduced a dialog to ask users if they will permit an app to access the local network. This appears for the first time when a Cordova app attempts to do a hot code reload if testing on the local network. It should be fixed so that it retries the request in this situation. Currently it fails and the app remains in the older version until the app is restarted/reloaded.

How to reproduce:

image

2020-10-07 13:29:30.360978-0700 meteor-clock[551:47742] Start downloading asset manifest from: manifest.json -- http://10.0.0.248:3000/__cordova/
2020-10-07 13:29:30.375173-0700 meteor-clock[551:47926] Connection 4: received failure notification
2020-10-07 13:29:30.375295-0700 meteor-clock[551:47926] Connection 4: failed to connect 1:50, reason -1
2020-10-07 13:29:30.375355-0700 meteor-clock[551:47926] Connection 4: encountered error(1:50)
2020-10-07 13:29:30.377824-0700 meteor-clock[551:47926] Task <91486B56-FA8A-4C7B-A1A7-D2B06F36D162>.<2> HTTP load failed, 0/0 bytes (error code: -1009 [1:50])
2020-10-07 13:29:30.382533-0700 meteor-clock[551:47828] Task <91486B56-FA8A-4C7B-A1A7-D2B06F36D162>.<2> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x280a44e70 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <91486B56-FA8A-4C7B-A1A7-D2B06F36D162>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <91486B56-FA8A-4C7B-A1A7-D2B06F36D162>.<2>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=http://10.0.0.248:3000/__cordova/manifest.json, NSErrorFailingURLKey=http://10.0.0.248:3000/__cordova/manifest.json, _kCFStreamErrorDomainKey=1}
2020-10-07 13:29:30.382855-0700 meteor-clock[551:47828] Download failure: Error downloading asset manifest: Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x280a44e70 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_kCFStreamErrorCodeKey=50, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <91486B56-FA8A-4C7B-A1A7-D2B06F36D162>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <91486B56-FA8A-4C7B-A1A7-D2B06F36D162>.<2>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=http://10.0.0.248:3000/__cordova/manifest.json, NSErrorFailingURLKey=http://10.0.0.248:3000/__cordova/manifest.json, _kCFStreamErrorDomainKey=1}
filipenevola commented 3 years ago

@hexsprite what is this repo clocks demo?

I never saw this problem before. In which cases it would happen? On real devices in the first HCP?

If that is really the case, I'm not getting this problem on my apps, what would be the workaround in your opinion?

hexsprite commented 3 years ago

Probably be more persistent at retrying failed requests for HCP would fix it.

hexsprite commented 3 years ago

Yeah its just the clocks demo, wanted something neutral to reproduce with.