cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Nikotin (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-12420) NativeToJsMessageQueue breaks the order of callbacks
Date Fri, 03 Feb 2017 12:24:51 GMT

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

Pavel Nikotin edited comment on CB-12420 at 2/3/17 12:24 PM:
-------------------------------------------------------------

I found solution: If don't dequeue in popAndEncodeAsJs function and just return this, than
everything works fine;
public String popAndEncodeAsJs() {
        return "window.setTimeout(function(){cordova.require(\"cordova/exec\").pollOnce();},0);";
}
And I had to add androidExec.pollOnce = pollOnce; to cordova.js


was (Author: pavel_vo):
I found solution: If don't dequeue in popAndEncodeAsJs function and just return this, than
everything forks fine;
public String popAndEncodeAsJs() {
        return "window.setTimeout(function(){cordova.require(\"cordova/exec\").pollOnce();},0);";
}
And I had to add androidExec.pollOnce = pollOnce; to cordova.js

> NativeToJsMessageQueue breaks the order of callbacks
> ----------------------------------------------------
>
>                 Key: CB-12420
>                 URL: https://issues.apache.org/jira/browse/CB-12420
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 6.4.0
>         Environment: Android 4.4.2, Android 5.1.1
>            Reporter: Pavel Nikotin
>            Priority: Minor
>
> I'm streaming data with cordova-plugin-chrome-apps-sockets-tcp plugin.
> I receive data in javascript not in the same order as tcp plugin put to sendPluginResult.
> I see that popAndEncode and popAndEncodeAsJs called from different places of cordova
sources. But only popAndEncodeAsJs method adds window.setTimeout(...,0); so I think It breaks
order.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message