You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by AlexMouton <gi...@git.apache.org> on 2015/04/10 00:25:23 UTC

[GitHub] cordova-ios pull request: Moved commandQueue push into non-WK_WEBV...

GitHub user AlexMouton opened a pull request:

    https://github.com/apache/cordova-ios/pull/136

    Moved commandQueue push into non-WK_WEBVIEW_BINDING branch.

    Hi Shazron
    I am working on an html5 video game that is packaged for ios using cordova.
    We were having memory issues with UIWebView and have integrated your work on WKWebView recently.
    Its working great for the performance! thanks! but, we are of course feeling alpha growing pains.
    
    One thing we have noticed is that when we invoke the cordova Barcode plugin, it is always called twice!
    
    I have only looked at the code a short time, but it appears to me that:
    * the first call to Barcode happens, and in iosExec, it gets placed in commandQueue.
    * the first call passes to Objective C world by WKScriptMessageHandler - (void)userContentController:(WKUserContentController*)userContentController didReceiveScriptMessage:(WKScriptMessage*)message
    * this call to Barcode does its thing, completes, and it's javascript response handler code winds through:
        CDVCommandDelegateImpl::sendPluginResult
        CDVCommandDelegateImpl::evalJSHelper
        CDVCommandDelegateImpl::evalJSHelper2
    * in Helper2, the callback is finally passed to a webViewEngine, which processes the Javascript, and returns, on completion, a list of commands remaining in the javascript commandQueue.
    * these commands are queued on the Obj-C side and run in CDVCommandQueue fashion.
    
    AHA!
    
    * since the command was persisted in commandQueue before execution, and not removed, it is called again!
    
    SO
    
    I moved the enqueue behavior into the branch that excludes bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING
    This fixes it, but I am not confident its the right solution.
    
    Do you have any insight into this problem?
    Feedback for my solution?
    A broader or more appropriate venue for the conversation?
    
    Thanks!
    Alex Mouton

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/skcamp/cordova-ios CB-8838-wkwebview-double-call

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-ios/pull/136.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #136
    
----
commit a4ff60b961c567e1de9077474ee76bbf0874341d
Author: Alex Mouton <th...@gmail.com>
Date:   2015-04-09T22:16:40Z

    Moved commandQueue push into non-WK_WEBVIEW_BINDING branch.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-ios pull request: [CB-8838]Moved commandQueue push into no...

Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on the pull request:

    https://github.com/apache/cordova-ios/pull/136#issuecomment-91383906
  
    Hi, thanks for the PR. Please also send a PR to the cordova-js repo. 
    
    The exec bridge code is undergoing a transition of repos, but for now we need to also update cordova-js. See: https://github.com/apache/cordova-js/blob/b4af1c5ec477dd98cd651932ea6df6d46705d7f9/src/ios/exec.js#L177



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-ios pull request: [CB-8838]Moved commandQueue push into no...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-ios/pull/136


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-ios pull request: [CB-8838]Moved commandQueue push into no...

Posted by shazron <gi...@git.apache.org>.
Github user shazron commented on the pull request:

    https://github.com/apache/cordova-ios/pull/136#issuecomment-112975173
  
    FYI this is in 4.0.x, will be auto-closed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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