You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by rodms10 <gi...@git.apache.org> on 2014/09/11 23:05:49 UTC

[GitHub] cordova-plugin-network-information pull request: Fix network infor...

GitHub user rodms10 opened a pull request:

    https://github.com/apache/cordova-plugin-network-information/pull/19

    Fix network information type exception on fxos 2

    `navigator.connection` got removed from fxos 2, causing the plugin to crash when loading. Fixed by returning  `UNKNOWN` when `navigator.connection` is not defined.
    
    This is a quick fix to get this into next release ASAP, I'll now investigate if there's any alternative. There was nothing useful on [the mdn page](https://developer.mozilla.org/en-US/docs/Web/API/Network_Information_API).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rodms10/cordova-plugin-network-information fxos2-fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-network-information/pull/19.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #19
    
----
commit ec96704786cd8cbe2efbbb264d4032f7c237c2e8
Author: Rodrigo Silveira <ro...@outlook.com>
Date:   2014-09-11T20:40:19Z

    Fix network information type exception on fxos 2

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-plugin-network-information pull request: Fix network infor...

Posted by zalun <gi...@git.apache.org>.
Github user zalun commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-network-information/pull/19#discussion_r17470520
  
    --- Diff: src/firefoxos/NetworkProxy.js ---
    @@ -34,8 +34,16 @@ module.exports = {
     
       getConnectionInfo: function(successCallback, errorCallback) {
         var connection = origConnection || navigator.mozConnection,
    -      connectionType = Connection.UNKNOWN,
    -      bandwidth = connection.bandwidth,
    +        connectionType = Connection.UNKNOWN;
    +
    +    if (!connection) {
    +        setTimeout(function() {
    --- End diff --
    
    Why there is a timeout?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-plugin-network-information pull request: Fix network infor...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-plugin-network-information/pull/19


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-plugin-network-information pull request: Fix network infor...

Posted by rodms10 <gi...@git.apache.org>.
Github user rodms10 commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-network-information/pull/19#discussion_r17488887
  
    --- Diff: src/firefoxos/NetworkProxy.js ---
    @@ -34,8 +34,16 @@ module.exports = {
     
       getConnectionInfo: function(successCallback, errorCallback) {
         var connection = origConnection || navigator.mozConnection,
    -      connectionType = Connection.UNKNOWN,
    -      bandwidth = connection.bandwidth,
    +        connectionType = Connection.UNKNOWN;
    +
    +    if (!connection) {
    +        setTimeout(function() {
    --- End diff --
    
    This is to make this an async call.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cordova-plugin-network-information pull request: Fix network infor...

Posted by zalun <gi...@git.apache.org>.
Github user zalun commented on the pull request:

    https://github.com/apache/cordova-plugin-network-information/pull/19#issuecomment-55381961
  
    r+


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---