You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Andrew Lunny (Created) (JIRA)" <ji...@apache.org> on 2012/02/13 23:45:05 UTC

[jira] [Created] (CB-250) [android] app crashes when DNS lookup fails

[android] app crashes when DNS lookup fails
-------------------------------------------

                 Key: CB-250
                 URL: https://issues.apache.org/jira/browse/CB-250
             Project: Apache Callback
          Issue Type: Bug
          Components: Android
    Affects Versions: 1.4.0
            Reporter: Andrew Lunny
            Assignee: Joe Bowser


If the DNS lookup on a link to loadUrl fails, the app exits.

Fil traced this to the onReceivedError method in CordovaWebViewClient - the ERROR_HOST_LOOKUP error code is being passed to that method, which is passed on to the context, and the app crashes.
http://developer.android.com/reference/android/webkit/WebViewClient.html#ERROR_HOST_LOOKUP

Expected behavior in this case is probably for an error to be reported back to the web view, and the initial page to be loaded back once more.

app demonstrating failure (has wildcard on whitelist): https://build.phonegap.com/apps/74059/share
source code: https://gist.github.com/1821047

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-250) [android] app crashes when DNS lookup fails

Posted by "Maciej Jaros (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208377#comment-13208377 ] 

Maciej Jaros commented on CB-250:
---------------------------------

The issue also occurs when you don't have a WiFi (or other connection) active - not sure if Android throws the same error then (I'm guessing it might be ERROR_CONNECT or ERROR_TIMEOUT).

As for the behavior - I would expect nothing to be loaded or reload - maybe just an alert could be displayed. If reloading is easier (e.g. WebView already loads the new page when the error occurs), then that would be acceptable if you ask me.
                
> [android] app crashes when DNS lookup fails
> -------------------------------------------
>
>                 Key: CB-250
>                 URL: https://issues.apache.org/jira/browse/CB-250
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.4.0
>            Reporter: Andrew Lunny
>            Assignee: Joe Bowser
>
> If the DNS lookup on a link to loadUrl fails, the app exits.
> Fil traced this to the onReceivedError method in CordovaWebViewClient - the ERROR_HOST_LOOKUP error code is being passed to that method, which is passed on to the context, and the app crashes.
> http://developer.android.com/reference/android/webkit/WebViewClient.html#ERROR_HOST_LOOKUP
> Expected behavior in this case is probably for an error to be reported back to the web view, and the initial page to be loaded back once more.
> app demonstrating failure (has wildcard on whitelist): https://build.phonegap.com/apps/74059/share
> source code: https://gist.github.com/1821047

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CB-250) [android] app crashes when DNS lookup fails

Posted by "Maciej Jaros (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13213634#comment-13213634 ] 

Maciej Jaros commented on CB-250:
---------------------------------

Maybe you could add a function (or event) that could be overwritten/overtaken by an application developer (from JS). The default behavior would be to show a simple alert box (e.g. "The URL is unreachable").

That way if an application developer wants to show their own alert or something else then he will be able do that, but also (by default) the app will not crash and will give some feedback to the user using the app.
                
> [android] app crashes when DNS lookup fails
> -------------------------------------------
>
>                 Key: CB-250
>                 URL: https://issues.apache.org/jira/browse/CB-250
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.4.0, 1.5.0
>            Reporter: Andrew Lunny
>            Assignee: Joe Bowser
>             Fix For: 1.6.0
>
>
> If the DNS lookup on a link to loadUrl fails, the app exits.
> Fil traced this to the onReceivedError method in CordovaWebViewClient - the ERROR_HOST_LOOKUP error code is being passed to that method, which is passed on to the context, and the app crashes.
> http://developer.android.com/reference/android/webkit/WebViewClient.html#ERROR_HOST_LOOKUP
> Expected behavior in this case is probably for an error to be reported back to the web view, and the initial page to be loaded back once more.
> app demonstrating failure (has wildcard on whitelist): https://build.phonegap.com/apps/74059/share
> source code: https://gist.github.com/1821047

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-250) [android] app crashes when DNS lookup fails

Posted by "Joe Bowser (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-250?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser resolved CB-250.
---------------------------

    Resolution: Fixed

Fixed in 1.6, will now 404 instead of show the fatal error box.
                
> [android] app crashes when DNS lookup fails
> -------------------------------------------
>
>                 Key: CB-250
>                 URL: https://issues.apache.org/jira/browse/CB-250
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.4.0, 1.5.0
>            Reporter: Andrew Lunny
>            Assignee: Joe Bowser
>             Fix For: 1.6.0
>
>
> If the DNS lookup on a link to loadUrl fails, the app exits.
> Fil traced this to the onReceivedError method in CordovaWebViewClient - the ERROR_HOST_LOOKUP error code is being passed to that method, which is passed on to the context, and the app crashes.
> http://developer.android.com/reference/android/webkit/WebViewClient.html#ERROR_HOST_LOOKUP
> Expected behavior in this case is probably for an error to be reported back to the web view, and the initial page to be loaded back once more.
> app demonstrating failure (has wildcard on whitelist): https://build.phonegap.com/apps/74059/share
> source code: https://gist.github.com/1821047

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CB-250) [android] app crashes when DNS lookup fails

Posted by "Joe Bowser (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-250?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joe Bowser updated CB-250:
--------------------------

    Affects Version/s: 1.5.0
        Fix Version/s: 1.6.0

This needs to be thought out more. Is an alert OK, or should we just fire an event?
                
> [android] app crashes when DNS lookup fails
> -------------------------------------------
>
>                 Key: CB-250
>                 URL: https://issues.apache.org/jira/browse/CB-250
>             Project: Apache Callback
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 1.4.0, 1.5.0
>            Reporter: Andrew Lunny
>            Assignee: Joe Bowser
>             Fix For: 1.6.0
>
>
> If the DNS lookup on a link to loadUrl fails, the app exits.
> Fil traced this to the onReceivedError method in CordovaWebViewClient - the ERROR_HOST_LOOKUP error code is being passed to that method, which is passed on to the context, and the app crashes.
> http://developer.android.com/reference/android/webkit/WebViewClient.html#ERROR_HOST_LOOKUP
> Expected behavior in this case is probably for an error to be reported back to the web view, and the initial page to be loaded back once more.
> app demonstrating failure (has wildcard on whitelist): https://build.phonegap.com/apps/74059/share
> source code: https://gist.github.com/1821047

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira