Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Large sync leads to timeout on iOS #213

Closed
bbreijer opened this issue Sep 6, 2016 · 6 comments
Closed

Large sync leads to timeout on iOS #213

bbreijer opened this issue Sep 6, 2016 · 6 comments

Comments

@bbreijer
Copy link
Contributor

bbreijer commented Sep 6, 2016

Problem

A large (or rather long) sync leads to a timeout on iOS. The behaviour is dependant on internet connection and transfer size.

The timeout is caused the session timeout: cordova-hot-code-push-plugin/src/ios/Network/HCPFileDownloader.m:37
Since all files are handled in a single session, the timeout is likely to occur on large transfers with slow connections.
(see also: http://stackoverflow.com/questions/23428793/nsurlsession-how-to-increase-time-out-for-url-requests)

Imho a (sequenced) session per file would be better. Another thing which might help to cope with this problem is setting the timeout from the config.xml.

Steps to reproduce
  1. create a (very) large change on the server
  2. try to download this change from an iOS device using a slow internet connection (transfer should be longer than 60 sec).
System info

Run cordova info (or ionic info) and paste it here, or give us information like:

  • Platform: iOS 9.3.5
  • Platform version:
  • Cordova version: 6.2.0
  • Node version: 5
@nikDemyankov
Copy link
Member

Thanks for the info, I'll look into it.

@bbreijer
Copy link
Contributor Author

bbreijer commented Sep 7, 2016

Additional info:
iOS runs out of memory with large files during installation. This can be managed by adding a NSAutoreleasePool to the inner loop of isUpdateValid after cordova-hot-code-push-plugin/src/ios/Updater/HCPInstallationWorker.m:174 in a way that memory is released after each file.
see https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSAutoreleasePool_Class/index.html for details (the @ notation).

Let me know if you would like me to push the changes we have been trying with.

@nikDemyankov
Copy link
Member

Thanks! If you have a pull request with improvements/fixes - it is always welcomed :)

@bbreijer
Copy link
Contributor Author

bbreijer commented Sep 8, 2016

see #217

@nikDemyankov nikDemyankov added this to the v1.5.2 milestone Sep 23, 2016
@nikDemyankov
Copy link
Member

Merged PR. Added some changes in the download process. Should now download large files as well, and be more memory efficient.

@nikDemyankov
Copy link
Member

Released in v1.5.2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants