Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1E0E1886F for ; Mon, 22 Jun 2015 15:47:19 +0000 (UTC) Received: (qmail 84099 invoked by uid 500); 22 Jun 2015 15:47:19 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 84058 invoked by uid 500); 22 Jun 2015 15:47:19 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 84041 invoked by uid 99); 22 Jun 2015 15:47:19 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2015 15:47:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A40751A5AAE for ; Mon, 22 Jun 2015 15:47:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.87 X-Spam-Level: ** X-Spam-Status: No, score=2.87 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=google.com header.b=ZHuSYkgh; dkim=pass (1024-bit key) header.d=chromium.org header.b=C94yJXtj Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id IX24vUWKXtjp for ; Mon, 22 Jun 2015 15:47:17 +0000 (UTC) Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id E2E5A4540D for ; Mon, 22 Jun 2015 15:47:16 +0000 (UTC) Received: by igblr2 with SMTP id lr2so56135261igb.0 for ; Mon, 22 Jun 2015 08:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=xr8IoGS3bS7cajcWWUtuvmvwHKYRwCtdMHghThlleF0=; b=ZHuSYkgheOBDRmoBSeLws6IhIy/UEEGpCICNxH/S6SmEH3QSVvAkra8xR+u6XmnhgN S94SSq+va96ft7jrJLWgOk+4deGFvyV9zSZ8/GxL8pHGl0E64yN3FirkhArO8uC3hv2w X7SqtZOu0+clzskZQYpBs3qoMaxZgPJ6S1GZwbDFk3n0Uhxlw5boDp+Jmtny+T3V1bY1 1+RCU4cS0jDBJK/D4DyGE0hTUw1G9novpII+VnFgj6sB5J8hl4UP2KGWI4rs+JkJgetr a3gyJpEYEHlOEFUHncG+PaZelXPdn7RLi9yb5t2/Dsu3XFK1REneQdAZUElWO5GwF5Hq 3s9Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=xr8IoGS3bS7cajcWWUtuvmvwHKYRwCtdMHghThlleF0=; b=C94yJXtjjr7t6B+FgB3RXlG+eMJAsQmd2bVOpbzSowan+6qIpQsU2eG7OUwsMNbpz0 fnTShmsLLRGXOUpsUNswH3GEgCpj1lfjo6tlmtlOd+nf9qZUOyPC3kCEmY/GshojQFX6 mZbc98MZUlXsiq2/D77M7Em4PXzGmN2oWESJs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=xr8IoGS3bS7cajcWWUtuvmvwHKYRwCtdMHghThlleF0=; b=Hp2cXbYisE8W8OISTaM396RDyEM8itioMKUyPMgmBuKwVwe2CIKWOX7gO7s1F0zw23 894MlpD31RdUHKGP5Qphw3XGEIyUVHn+N5ABus6tpjthKEhACS63izOqigx+19fHbRMc GGzXWLVRm+LOTucO35+uPhrPiJpsGP6qStZYpmdEM/mQXGmQDga/3IXu/xP3BUrAqOm3 itZbV3MRYgt6vZl6+HFTenb373za4TGDmBLzAVNZrW4N3FAMFPagh3KBkoipebAhnnLM qRJx2gBSS/VU40/NT4X4Tzot3AOGGyanX/i2SN9o9v8HWk8o0aPoTJEnI5Z7f8g5FDRq NbtA== X-Gm-Message-State: ALoCoQmR7U1R9/GQKjeFuoRnGNQrBiSjmjSG6Crvrow8Ge89O3vv8bdWOuXwkE2qSYazCKNuhuvI X-Received: by 10.50.117.35 with SMTP id kb3mr22235107igb.13.1434988030086; Mon, 22 Jun 2015 08:47:10 -0700 (PDT) MIME-Version: 1.0 Sender: agrieve@google.com Received: by 10.36.130.198 with HTTP; Mon, 22 Jun 2015 08:46:50 -0700 (PDT) In-Reply-To: References: From: Andrew Grieve Date: Mon, 22 Jun 2015 11:46:50 -0400 X-Google-Sender-Auth: 0l30nlcdJ5T5FrpHAS5ybR-M7sM Message-ID: Subject: Re: Cordova issue. To: David Hadas , dev Cc: Andrew Grieve Content-Type: multipart/alternative; boundary=089e01183c9eca84e405191d2f33 --089e01183c9eca84e405191d2f33 Content-Type: text/plain; charset=UTF-8 + dev@ mailing list There have been (fixed) bugs with the online bridge in the past. Are you running a recent version of cordova-android? https://issues.apache.org/jira/browse/CB-6761 https://issues.apache.org/jira/browse/CB-6746 As a quick fix, you can switch to use the PROMPT-based bridge. On Sun, Jun 21, 2015 at 6:31 PM, David Hadas wrote: > Hi agrieve, > > While hunting what initialy appeared to be a "file plugin bug" on a an S3 > Neo android 4.3 device, we had learned that OnlineEventsBridgeMode seem to > be broken on that device. We noticed that from a certain point in time, > the boolean *online* was always set to false during toggleNetworkRunnable > { ...webView.setNetworkAvailable(*online*) } - hence *online* was no > longer toggled via notifyOfFlush - consequently there were no more > webView *online *events sent out to the JS. From that moment events from > JAVA to JS were delivered only when someone from the JS was > calling androidExec (cordova.js) and we were always missing the last set of > events as there were stuck down at the JAVA queue. > > We realized that the OnlineEventsBridgeMode depends on the boolean > *online* always being maintained as an inverse of the WebView > online-state. Once it is reversed for any reason/bug, the system never > corrects itself. > > Till now we were unable to track down the exact sequance leading to the > reversal event, but we do notice a sequance of two consecutive calls to notifyOfFlush, > flipping *online* twice - thereafter *online* is left unchanged (stuck on > teh wrong value). > > In fact we are somewhat uncomfirtable with the design choice of using > online toggling and blindly trying to keep the *online* variable as an > inverse of the WebView state. Our main conccern there is that this design > does not converge to a stable state and does not follow a KISS methodology > which may be painful in view of the asynchnous environment, dependency on > different WebView implementations etc, as a result implementation issues > and bugs such as the one we encuntered are more likely. We are wondering > about a simpler design choice of replacing: > webView.setNetworkAvailable(*online*); > with: > webView.setNetworkAvailable(*true*); // trigger an event > webView.setNetworkAvailable(*false*); // reset the webView to its > default state > thereafter removing redundent code such as the notifyOfFlush mechanism > which would no longer be needed, the JS event listener for offline etc. > > This apperently solved the problem with that S3 NEO android 4.3 - but may > be a better strategy to follow alltogether. > If so, we might be able to take the challange and suggest a patch or > better so, work with an existing contributer to create one. > > Please advise, > David Hadas > --089e01183c9eca84e405191d2f33--