Wizcorp / phonegap-plugin-wizCanvas

WizCanvas allows a developer to create a ultra-performant native canvas component. The view is based on the Ejecta framework and has WebGL support.
MIT License
43 stars 13 forks source link

Lost messages between views in Android #20

Closed jrouault closed 10 years ago

jrouault commented 10 years ago

In Android, messages sent between views are sometimes lost. An easy way to reproduce this with the sample project is to push hundred of messages between views, such as:

In www/index.html, replace line 406 to 414 by:

    var nbMessages = 100;
    function messageCanvasView() {
        var i;
        for (i = 0; i < nbMessages; i++) {
            messageCanvasViewStep();
        }
    }

    function messageCanvasViewStep() {
        var params = { test: "test" };
        wizCanvasMessenger.postMessage(params, "newCanvas");
    }

In www/assets/canvas/index.js, replace line 74 to 80 by:

var nbMessagesReceived = 0;
window.addEventListener( 'message', function( e ) {
    nbMessagesReceived++;
    console.log("Nb messages received: " + nbMessagesReceived);
}, false );
aogilvie commented 10 years ago

@jrouault I believe this is now fixed?

jrouault commented 10 years ago

@aogilvie Yes, fixed with one of the latest PR. Thanks!