Topic
  • 2 replies
  • Latest Post - ‏2013-02-06T10:07:31Z by IdanAdar
SystemAdmin
SystemAdmin
2327 Posts

Pinned topic Direct update does not recover if network disconnected/restored

‏2013-01-23T21:11:12Z |
We noticed a direct update problem while testing our Android app. We are trying to simulate a network disconnection during the update, and trying to recover the update after restoring the connection. We have been able to reproduce this on 5.0.5 and 5.0.5.1 using both emulators (4.1.2) and device (4.2).

I was wondering if anyone else has come across this type of connection issue and direct update? Thanks.

Steps to reproduce
1. Update any JS, CSS, HTML file in the Worklight project, and then build and deploy the app.
2. Launch the app. The 'Update is Available' prompt appears.
3. Go to device/emulator settings and disconnect the network connection on the device (turn on Airplane Mode on the emulator).
4. Return to app. click "Update". Confirm the update failed (the 'Update Failed' prompt appears).
5. Go to device/emulator settings, re-enable the network on the device (disable Airplane Mode)
6. Return to app, click "Reload" and/or "Exit"

Observations
1. Clicking Exit -> successfully closes the app. Launching the app again will prompt the user to download the update and if selected the update is successful.
2. Clicking Reload -> the app attempts to download the update, fails with the below exception, and the Update Failed message is displayed again.


01-21 11:11:50.661: D/WLDroidGap(1660): setCookies() can
't parse cookie null. 01-21 11:11:51.082: W/DefaultRequestDirector(1660): Authentication error: Unable to respond to any of these challenges: 
{wl-composite-challenge=WWW-Authenticate: WL-Composite-Challenge
} 01-21 11:11:51.082: D/WLDroidGap(1660): Faild to downloading update zip file - content type is application/json; charset=UTF-8, 

while it should be application/zip 01-21 11:11:51.091: D/WLDroidGap(1660): Finish copy files to local storage from updated zip file... 01-21 11:11:51.091: E/WLDroidGap(1660): Failed downloading application update file. 01-21 11:11:51.171: W/webview_proxy(1660): java.lang.Throwable: Warning: A WebView method was called on thread 
'AsyncTask #1'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads. 01-21 11:11:51.171: W/webview_proxy(1660):     at android.webkit.WebView.checkThread(WebView.java:1796) 01-21 11:11:51.171: W/webview_proxy(1660):     at android.webkit.WebView.canGoBack(WebView.java:894) 01-21 11:11:51.171: W/webview_proxy(1660):        at org.apache.cordova.CordovaWebView.canGoBack(CordovaWebView.java:620) 01-21 11:11:51.171: W/webview_proxy(1660):      at org.apache.cordova.DroidGap.loadSpinner(DroidGap.java:381) 01-21 11:11:51.171: W/webview_proxy(1660):        at org.apache.cordova.DroidGap.loadUrl(DroidGap.java:369) 01-21 11:11:51.171: W/webview_proxy(1660):    at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:315) 01-21 11:11:51.171: W/webview_proxy(1660):  at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:306) 01-21 11:11:51.171: W/webview_proxy(1660):  at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.handleUpdateException(WebResourcesDownloaderPlugin.java:218) 01-21 11:11:51.171: W/webview_proxy(1660):  at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.runDirectUpdate(WebResourcesDownloaderPlugin.java:192) 01-21 11:11:51.171: W/webview_proxy(1660):        at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:145) 01-21 11:11:51.171: W/webview_proxy(1660):         at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:102) 01-21 11:11:51.171: W/webview_proxy(1660):         at android.os.AsyncTask$2.call(AsyncTask.java:287) 01-21 11:11:51.171: W/webview_proxy(1660):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 01-21 11:11:51.171: W/webview_proxy(1660):        at java.util.concurrent.FutureTask.run(FutureTask.java:137) 01-21 11:11:51.171: W/webview_proxy(1660):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 01-21 11:11:51.171: W/webview_proxy(1660):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 01-21 11:11:51.171: W/webview_proxy(1660):   at java.lang.Thread.run(Thread.java:856) 01-21 11:11:51.471: D/dalvikvm(1660): GC_CONCURRENT freed 403K, 7% free 8804K/9415K, paused 21ms+189ms, total 375ms 01-21 11:11:51.551: W/webview_proxy(1660): java.lang.Throwable: Warning: A WebView method was called on thread 
'AsyncTask #1'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads. 01-21 11:11:51.551: W/webview_proxy(1660):  at android.webkit.WebView.checkThread(WebView.java:1796) 01-21 11:11:51.551: W/webview_proxy(1660):     at android.webkit.WebView.loadUrl(WebView.java:767) 01-21 11:11:51.551: W/webview_proxy(1660):  at org.apache.cordova.CordovaWebView.loadUrlNow(CordovaWebView.java:504) 01-21 11:11:51.551: W/webview_proxy(1660):     at org.apache.cordova.CordovaWebView.loadUrl(CordovaWebView.java:388) 01-21 11:11:51.551: W/webview_proxy(1660):        at org.apache.cordova.DroidGap.loadUrl(DroidGap.java:371) 01-21 11:11:51.551: W/webview_proxy(1660):    at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:315) 01-21 11:11:51.551: W/webview_proxy(1660):  at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:306) 01-21 11:11:51.551: W/webview_proxy(1660):  at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.handleUpdateException(WebResourcesDownloaderPlugin.java:218) 01-21 11:11:51.551: W/webview_proxy(1660):  at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.runDirectUpdate(WebResourcesDownloaderPlugin.java:192) 01-21 11:11:51.551: W/webview_proxy(1660):        at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:145) 01-21 11:11:51.551: W/webview_proxy(1660):         at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:102) 01-21 11:11:51.551: W/webview_proxy(1660):         at android.os.AsyncTask$2.call(AsyncTask.java:287) 01-21 11:11:51.551: W/webview_proxy(1660):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 01-21 11:11:51.551: W/webview_proxy(1660):        at java.util.concurrent.FutureTask.run(FutureTask.java:137) 01-21 11:11:51.551: W/webview_proxy(1660):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 01-21 11:11:51.551: W/webview_proxy(1660):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 01-21 11:11:51.551: W/webview_proxy(1660):   at java.lang.Thread.run(Thread.java:856) 01-21 11:11:51.981: W/webview_proxy(1660): java.lang.Throwable: Warning: A WebView method was called on thread 
'AsyncTask #1'. All WebView methods must be called on the UI thread. Future versions of WebView may not support use on other threads. 01-21 11:11:51.981: W/webview_proxy(1660):      at android.webkit.WebView.checkThread(WebView.java:1796) 01-21 11:11:51.981: W/webview_proxy(1660):     at android.webkit.WebView.addJavascriptInterface(WebView.java:1487) 01-21 11:11:51.981: W/webview_proxy(1660):  at com.worklight.androidgap.WLDroidGap.bindBrowser(WLDroidGap.java:215) 01-21 11:11:51.981: W/webview_proxy(1660):      at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:316) 01-21 11:11:51.981: W/webview_proxy(1660):  at com.worklight.androidgap.WLDroidGap.loadUrl(WLDroidGap.java:306) 01-21 11:11:51.981: W/webview_proxy(1660):  at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.handleUpdateException(WebResourcesDownloaderPlugin.java:218) 01-21 11:11:51.981: W/webview_proxy(1660):  at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.runDirectUpdate(WebResourcesDownloaderPlugin.java:192) 01-21 11:11:51.981: W/webview_proxy(1660):        at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:145) 01-21 11:11:51.981: W/webview_proxy(1660):         at com.worklight.androidgap.plugin.WebResourcesDownloaderPlugin$WebResourcesDownloader.doInBackground(WebResourcesDownloaderPlugin.java:102) 01-21 11:11:51.981: W/webview_proxy(1660):         at android.os.AsyncTask$2.call(AsyncTask.java:287) 01-21 11:11:51.981: W/webview_proxy(1660):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 01-21 11:11:51.981: W/webview_proxy(1660):        at java.util.concurrent.FutureTask.run(FutureTask.java:137) 01-21 11:11:51.981: W/webview_proxy(1660):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 01-21 11:11:51.981: W/webview_proxy(1660):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 01-21 11:11:51.981: W/webview_proxy(1660):   at java.lang.Thread.run(Thread.java:856)
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Direct update does not recover if network disconnected/restored

    ‏2013-01-24T16:00:27Z  
    Hi, thank you for reporting this unfortunate defect; I have confirmed it and opened a Customer Issue for this.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • IdanAdar
    IdanAdar
    741 Posts

    Re: Direct update does not recover if network disconnected/restored

    ‏2013-02-06T10:07:31Z  
    Hi,

    Quick FYI - this is now fixed and will be available in the next release of IBM Worklight.
    Thank you for reporting!

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform