cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-7104) Plugin results not transmitted back to devices (specially Samsung S4 and S5)
Date Thu, 10 Jul 2014 20:09:05 GMT

    [ https://issues.apache.org/jira/browse/CB-7104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14057878#comment-14057878
] 

ASF GitHub Bot commented on CB-7104:
------------------------------------

Github user nolanlawson commented on the pull request:

    https://github.com/apache/cordova-android/pull/105#issuecomment-48657215
  
    BTW I also tried, as a workaround, to consistently execute `callbackContext.success()`
or `failure()` for every callback (since I believe you said it might be caused by a callback
not being called). But that didn't change the behavior.


> Plugin results not transmitted back to devices (specially Samsung S4 and S5)
> ----------------------------------------------------------------------------
>
>                 Key: CB-7104
>                 URL: https://issues.apache.org/jira/browse/CB-7104
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.3.0
>            Reporter: HÃ¥kon Nilsen
>            Priority: Blocker
>              Labels: patch
>
> Our app relies heavily on Cordova plugins for communicating between JavaScript and native,
and on certain devices these messages are not consistently sent back to the JavaScript API.
> I've tracked it down to a problem with webView.setNetworkAvailable()-usage in NativeToJsMessageQueue.java,
and I have a suggestion for a fix.
> The problem with the current setup of (3.3.0) of NativeToJsMessageQueue seems to be that
the online flag is toggled every time a plugin is fired, while webView.setNetworkAvailable(online)
is only fired if the queue has messages.
> Since not all plugins have messages, the online flag can be toggled twice, and the online
flag will be i.e. false for each time the command is run - which means Cordova won't send
any messages.
> On Samsung S4 and S5 the hideKeyboard-event is slower or faster than other devices, which
results in a doble toggle of the online flag. This leads to the following command being sent
when there is a message in the queue:
> webView.setNetworkAvailable(false); // first message
> webView.setNetworkAvailable(false); // second message, which is not being sent
> webView.setNetworkAvailable(false); // third message, which will be sent
> For us it has been a terrible blocker, and I've made a change to the OnlineEventsBridgeMode
in NativeToJsMessageQueue.java that addresses this.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message