You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Michael Brooks (Created) (JIRA)" <ji...@apache.org> on 2011/11/30 20:11:40 UTC
[jira] [Created] (CB-97) navigator.network.connection.getInfo
returns wrong parameter to callback
navigator.network.connection.getInfo returns wrong parameter to callback
------------------------------------------------------------------------
Key: CB-97
URL: https://issues.apache.org/jira/browse/CB-97
Project: Apache Callback
Issue Type: Bug
Components: BlackBerry
Reporter: Michael Brooks
The blackberry implementation returns a JSON object to the getInfo success callback.
Android, for example, returns just a string.
Which one is the right one? I can't tell from the callback-test repo.
Here's an example of a problem I have currently on an Android and BlackBerry callback project:
{code}
navigator.network.connection.getInfo(
function(type)
{
if(type == "none" || (typeof type.type != 'undefined' && type.type == 'none'))
{
alert('no connection');
}
else
{
alert('connectioN!');
}
},
function()
{
alert('something bad happened');
});
{code}
So the getInfo callback, in Android case, compares to a string; BlackBerry has to check it's an object and look at one of the object properties.
--
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] [Assigned] (CB-97) navigator.network.connection.getInfo
returns wrong parameter to callback
Posted by "Filip Maj (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CB-97?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Filip Maj reassigned CB-97:
---------------------------
Assignee: Filip Maj
> navigator.network.connection.getInfo returns wrong parameter to callback
> ------------------------------------------------------------------------
>
> Key: CB-97
> URL: https://issues.apache.org/jira/browse/CB-97
> Project: Apache Callback
> Issue Type: Bug
> Components: BlackBerry
> Reporter: Michael Brooks
> Assignee: Filip Maj
>
> The blackberry implementation returns a JSON object to the getInfo success callback.
> Android, for example, returns just a string.
> Which one is the right one? I can't tell from the callback-test repo.
> Here's an example of a problem I have currently on an Android and BlackBerry callback project:
> {code}
> navigator.network.connection.getInfo(
> function(type)
> {
> if(type == "none" || (typeof type.type != 'undefined' && type.type == 'none'))
> {
> alert('no connection');
> }
> else
> {
> alert('connectioN!');
> }
> },
> function()
> {
> alert('something bad happened');
> });
> {code}
> So the getInfo callback, in Android case, compares to a string; BlackBerry has to check it's an object and look at one of the object properties.
--
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-97) navigator.network.connection.getInfo
returns wrong parameter to callback
Posted by "Filip Maj (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CB-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13167999#comment-13167999 ]
Filip Maj commented on CB-97:
-----------------------------
Simon, good catch. That pretty much makes this ticket invalid.
> navigator.network.connection.getInfo returns wrong parameter to callback
> ------------------------------------------------------------------------
>
> Key: CB-97
> URL: https://issues.apache.org/jira/browse/CB-97
> Project: Apache Callback
> Issue Type: Bug
> Components: BlackBerry
> Reporter: Michael Brooks
> Assignee: Filip Maj
>
> The blackberry implementation returns a JSON object to the getInfo success callback.
> Android, for example, returns just a string.
> Which one is the right one? I can't tell from the callback-test repo.
> Here's an example of a problem I have currently on an Android and BlackBerry callback project:
> {code}
> navigator.network.connection.getInfo(
> function(type)
> {
> if(type == "none" || (typeof type.type != 'undefined' && type.type == 'none'))
> {
> alert('no connection');
> }
> else
> {
> alert('connectioN!');
> }
> },
> function()
> {
> alert('something bad happened');
> });
> {code}
> So the getInfo callback, in Android case, compares to a string; BlackBerry has to check it's an object and look at one of the object properties.
--
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] [Closed] (CB-97) navigator.network.connection.getInfo
returns wrong parameter to callback
Posted by "Filip Maj (Closed) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CB-97?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Filip Maj closed CB-97.
-----------------------
Resolution: Invalid
Verified invalid - as per Simon's comments the function itself should not be in use. Verified that native code has listeners in place and fires appropriate callbacks to update properties on the `navigator.network.connection` object with the right data coverage type.
> navigator.network.connection.getInfo returns wrong parameter to callback
> ------------------------------------------------------------------------
>
> Key: CB-97
> URL: https://issues.apache.org/jira/browse/CB-97
> Project: Apache Callback
> Issue Type: Bug
> Components: BlackBerry
> Reporter: Michael Brooks
> Assignee: Filip Maj
>
> The blackberry implementation returns a JSON object to the getInfo success callback.
> Android, for example, returns just a string.
> Which one is the right one? I can't tell from the callback-test repo.
> Here's an example of a problem I have currently on an Android and BlackBerry callback project:
> {code}
> navigator.network.connection.getInfo(
> function(type)
> {
> if(type == "none" || (typeof type.type != 'undefined' && type.type == 'none'))
> {
> alert('no connection');
> }
> else
> {
> alert('connectioN!');
> }
> },
> function()
> {
> alert('something bad happened');
> });
> {code}
> So the getInfo callback, in Android case, compares to a string; BlackBerry has to check it's an object and look at one of the object properties.
--
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-97) navigator.network.connection.getInfo
returns wrong parameter to callback
Posted by "Michael Brooks (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CB-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160244#comment-13160244 ]
Michael Brooks commented on CB-97:
----------------------------------
Imported from https://github.com/callback/callback-blackberry/issues/1
Posted by Fil Maj
> navigator.network.connection.getInfo returns wrong parameter to callback
> ------------------------------------------------------------------------
>
> Key: CB-97
> URL: https://issues.apache.org/jira/browse/CB-97
> Project: Apache Callback
> Issue Type: Bug
> Components: BlackBerry
> Reporter: Michael Brooks
>
> The blackberry implementation returns a JSON object to the getInfo success callback.
> Android, for example, returns just a string.
> Which one is the right one? I can't tell from the callback-test repo.
> Here's an example of a problem I have currently on an Android and BlackBerry callback project:
> {code}
> navigator.network.connection.getInfo(
> function(type)
> {
> if(type == "none" || (typeof type.type != 'undefined' && type.type == 'none'))
> {
> alert('no connection');
> }
> else
> {
> alert('connectioN!');
> }
> },
> function()
> {
> alert('something bad happened');
> });
> {code}
> So the getInfo callback, in Android case, compares to a string; BlackBerry has to check it's an object and look at one of the object properties.
--
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-97) navigator.network.connection.getInfo
returns wrong parameter to callback
Posted by "Simon MacDonald (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CB-97?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13160253#comment-13160253 ]
Simon MacDonald commented on CB-97:
-----------------------------------
Well, it is a difference in implementation between Android and BB. However, the getInfo method should really be considered a private function. The Connection class uses the getInfo function to update it's type property. The best, and easiest way to check the connection state is to just interrogate:
if (navigator.network.connection.type == "none") {
alert("no connection");
} else {
alert("connection!");
}
Each time the native side determines there is a change in a connection type it calls getInfo as it's success callback.
> navigator.network.connection.getInfo returns wrong parameter to callback
> ------------------------------------------------------------------------
>
> Key: CB-97
> URL: https://issues.apache.org/jira/browse/CB-97
> Project: Apache Callback
> Issue Type: Bug
> Components: BlackBerry
> Reporter: Michael Brooks
>
> The blackberry implementation returns a JSON object to the getInfo success callback.
> Android, for example, returns just a string.
> Which one is the right one? I can't tell from the callback-test repo.
> Here's an example of a problem I have currently on an Android and BlackBerry callback project:
> {code}
> navigator.network.connection.getInfo(
> function(type)
> {
> if(type == "none" || (typeof type.type != 'undefined' && type.type == 'none'))
> {
> alert('no connection');
> }
> else
> {
> alert('connectioN!');
> }
> },
> function()
> {
> alert('something bad happened');
> });
> {code}
> So the getInfo callback, in Android case, compares to a string; BlackBerry has to check it's an object and look at one of the object properties.
--
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