Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F2150200BB1 for ; Wed, 19 Oct 2016 13:29:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id F107C160ADE; Wed, 19 Oct 2016 11:29:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4C7F3160AEA for ; Wed, 19 Oct 2016 13:29:59 +0200 (CEST) Received: (qmail 55647 invoked by uid 500); 19 Oct 2016 11:29:58 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 55543 invoked by uid 99); 19 Oct 2016 11:29:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Oct 2016 11:29:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 548752C4C71 for ; Wed, 19 Oct 2016 11:29:58 +0000 (UTC) Date: Wed, 19 Oct 2016 11:29:58 +0000 (UTC) From: "jakub-g (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-12035) [cordova-plugin-network-information] connection info is not reliable on Android 6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 19 Oct 2016 11:30:00 -0000 [ https://issues.apache.org/jira/browse/CB-12035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] jakub-g updated CB-12035: ------------------------- Description: I've noticed that information exposed by the plugin is not reliable. It happens often that I'm connected to the internet via WiFi, and the plugin says that there's no connection. It's not easy to reproduce it on-demand, but I reproduced it many times recently. It happens most often when in the morning, I open the Cordova app that was running in background throughout the night. Then, when I connect to Chrome Dev Tools, I can do a repl session like this: {{code}} > navigator.connection.type "none" > window.fetch('http://www.example.org').then(function(res) {console.log(res.status)}) Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined} 200 Fetch complete: GET "http://www.example.org/".(anonymous function) > navigator.connection.type "none" {{code}} So, the plugin thinks I'm offline, yet any HTTP calls done within the app without checking if I'm offline or online, are successful (either from the app or devtools). When I disable WiFi and reenable it, after a few seconds the plugin updates its state and then it tells that connection type is "wifi". There are several possibilities here: - either system (or device driver) gives us incorrect information, or - cordova plugin is caching data and/or not listening properly to all the events and/or incorrectly processing it and most probably the issue manifests itself when the device is asleep for many hours (but I'm not sure about this). Note that I also noticed another issue, that sometimes the Chrome network stack thinks I'm offline (when I do an HTTP call, it fails immediately and I see network errors in devtools console) - and then I restart the Cordova app, and everything's fine, all HTTP calls are ok - but this is unrelated to this ticket, and perhaps a bug in Chrome. This ticket seems to be most likely a bug in the plugin, because as I said before, doing HTTP call succeeds despite the plugin telling me that I'm offline. was: I've noticed that information exposed by the plugin is not reliable. It happens often that I'm connected to the internet via WiFi, and the plugin says that there's no connection. It's not easy to reproduce it on-demand, but I reproduced it many times recently. It happens most often when in the morning, I open the Cordova app that was running in background throughout the night. Then, when I connect to Chrome Dev Tools, I can do a repl session like this: > navigator.connection.type "none" > window.fetch('http://www.example.org').then(function(res) {console.log(res.status)}) Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined} 200 Fetch complete: GET "http://www.example.org/".(anonymous function) > navigator.connection.type "none" So, the plugin thinks I'm offline, yet any HTTP calls done within the app without checking if I'm offline or online, are successful (either from the app or devtools). When I disable WiFi and reenable it, after a few seconds the plugin updates its state and then it tells that connection type is "wifi". There are several possibilities here: - either system (or device driver) gives us incorrect information, or - cordova plugin is caching data and/or not listening properly to all the events and/or incorrectly processing it and most probably the issue manifests itself when the device is asleep for many hours (but I'm not sure about this). Note that I also noticed another issue, that sometimes the Chrome network stack thinks I'm offline (when I do an HTTP call, it fails immediately and I see network errors in devtools console) - and then I restart the Cordova app, and everything's fine, all HTTP calls are ok - but this is unrelated to this ticket, and perhaps a bug in Chrome. This ticket seems to be most likely a bug in the plugin, because as I said before, doing HTTP call succeeds despite the plugin telling me that I'm offline. > [cordova-plugin-network-information] connection info is not reliable on Android 6 > --------------------------------------------------------------------------------- > > Key: CB-12035 > URL: https://issues.apache.org/jira/browse/CB-12035 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Environment: Samsung Galaxy Edge S6 / Android 6 > useragent: "Mozilla/5.0 (Linux; Android 6.0.1; SM-G925F Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.124 Mobile Safari/537.36" > reproduced with: > cordova-plugin-network-information@1.3.0 (latest) > cordova-plugin-network-information@1.2.0 > Reporter: jakub-g > > I've noticed that information exposed by the plugin is not reliable. It happens often that I'm connected to the internet via WiFi, and the plugin says that there's no connection. > It's not easy to reproduce it on-demand, but I reproduced it many times recently. It happens most often when in the morning, I open the Cordova app that was running in background throughout the night. > Then, when I connect to Chrome Dev Tools, I can do a repl session like this: > {{code}} > > navigator.connection.type > "none" > > window.fetch('http://www.example.org').then(function(res) {console.log(res.status)}) > Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined} > 200 > Fetch complete: GET "http://www.example.org/".(anonymous function) > > navigator.connection.type > "none" > {{code}} > So, the plugin thinks I'm offline, yet any HTTP calls done within the app without checking if I'm offline or online, are successful (either from the app or devtools). > When I disable WiFi and reenable it, after a few seconds the plugin updates its state and then it tells that connection type is "wifi". > There are several possibilities here: > - either system (or device driver) gives us incorrect information, or > - cordova plugin is caching data and/or not listening properly to all the events and/or incorrectly processing it > and most probably the issue manifests itself when the device is asleep for many hours (but I'm not sure about this). > Note that I also noticed another issue, that sometimes the Chrome network stack thinks I'm offline (when I do an HTTP call, it fails immediately and I see network errors in devtools console) - and then I restart the Cordova app, and everything's fine, all HTTP calls are ok - but this is unrelated to this ticket, and perhaps a bug in Chrome. > This ticket seems to be most likely a bug in the plugin, because as I said before, doing HTTP call succeeds despite the plugin telling me that I'm offline. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org