You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Matthew Windwer (JIRA)" <ji...@apache.org> on 2012/09/07 07:13:09 UTC

[jira] [Created] (CB-1385) 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec

Matthew Windwer created CB-1385:
-----------------------------------

             Summary: 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec
                 Key: CB-1385
                 URL: https://issues.apache.org/jira/browse/CB-1385
             Project: Apache Cordova
          Issue Type: Bug
          Components: CordovaJS, iOS
    Affects Versions: 2.1.0
         Environment: iOS
            Reporter: Matthew Windwer
            Assignee: Filip Maj
             Fix For: 2.1.0


This was brought to my attention when the InAppPurchaseManager plugin no longer worked for me on 2.1.0rc2, but was working in 2.0.

The issue happens when calling cordova.exec using "FORMAT TWO", e.g:

cordova.exec('InAppPurchaseManager.requestProductData', productId, callback + '.success', callback + '.fail');

When the arguments get to the native side there is an extra null value preceding the rest of the arguments. This is only a problem when the plugin expects the arguments to be in a certain order, like for InAppPurchaseManager. A workaround for InAppPurchaseManager is to increase the index by one for each call in the .m file (e.g. [arguments objectAtIndex:0] becomes [arguments objectAtIndex:1]).

The extra null value is the callbackId, which is always going to be null using "FORMAT 2". The code that handles this was refactored since 2.0, which may be the source of the problem, in particular around line 959 of the current cordova.js:

 var command = [callbackId, service, action, actionArgs];



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1385) 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec

Posted by "Matthew Windwer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452804#comment-13452804 ] 

Matthew Windwer commented on CB-1385:
-------------------------------------

Fix works like a charm, glad I was able to help out!
                
> 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec
> -----------------------------------------------------------------------------------------------
>
>                 Key: CB-1385
>                 URL: https://issues.apache.org/jira/browse/CB-1385
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 2.1.0
>         Environment: iOS
>            Reporter: Matthew Windwer
>            Assignee: Andrew Grieve
>             Fix For: 2.1.0
>
>
> This was brought to my attention when the InAppPurchaseManager plugin no longer worked for me on 2.1.0rc2, but was working in 2.0.
> The issue happens when calling cordova.exec using "FORMAT TWO", e.g:
> cordova.exec('InAppPurchaseManager.requestProductData', productId, callback + '.success', callback + '.fail');
> When the arguments get to the native side there is an extra null value preceding the rest of the arguments. This is only a problem when the plugin expects the arguments to be in a certain order, like for InAppPurchaseManager. A workaround for InAppPurchaseManager is to increase the index by one for each call in the .m file (e.g. [arguments objectAtIndex:0] becomes [arguments objectAtIndex:1]).
> The extra null value is the callbackId, which is always going to be null using "FORMAT 2". The code that handles this was refactored since 2.0, which may be the source of the problem, in particular around line 959 of the current cordova.js:
>  var command = [callbackId, service, action, actionArgs];

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CB-1385) 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Grieve resolved CB-1385.
-------------------------------

    Resolution: Fixed

Matthew, thanks again for finding this!

Fix commit: https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-ios.git;a=commit;h=6aa58d21c25cc8bd4fca94222dfdae88e91903ad
                
> 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec
> -----------------------------------------------------------------------------------------------
>
>                 Key: CB-1385
>                 URL: https://issues.apache.org/jira/browse/CB-1385
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 2.1.0
>         Environment: iOS
>            Reporter: Matthew Windwer
>            Assignee: Andrew Grieve
>             Fix For: 2.1.0
>
>
> This was brought to my attention when the InAppPurchaseManager plugin no longer worked for me on 2.1.0rc2, but was working in 2.0.
> The issue happens when calling cordova.exec using "FORMAT TWO", e.g:
> cordova.exec('InAppPurchaseManager.requestProductData', productId, callback + '.success', callback + '.fail');
> When the arguments get to the native side there is an extra null value preceding the rest of the arguments. This is only a problem when the plugin expects the arguments to be in a certain order, like for InAppPurchaseManager. A workaround for InAppPurchaseManager is to increase the index by one for each call in the .m file (e.g. [arguments objectAtIndex:0] becomes [arguments objectAtIndex:1]).
> The extra null value is the callbackId, which is always going to be null using "FORMAT 2". The code that handles this was refactored since 2.0, which may be the source of the problem, in particular around line 959 of the current cordova.js:
>  var command = [callbackId, service, action, actionArgs];

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1385) 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452155#comment-13452155 ] 

Shazron Abdullah commented on CB-1385:
--------------------------------------

I'll take this on - thanks Andrew.
                
> 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec
> -----------------------------------------------------------------------------------------------
>
>                 Key: CB-1385
>                 URL: https://issues.apache.org/jira/browse/CB-1385
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 2.1.0
>         Environment: iOS
>            Reporter: Matthew Windwer
>            Assignee: Andrew Grieve
>             Fix For: 2.1.0
>
>
> This was brought to my attention when the InAppPurchaseManager plugin no longer worked for me on 2.1.0rc2, but was working in 2.0.
> The issue happens when calling cordova.exec using "FORMAT TWO", e.g:
> cordova.exec('InAppPurchaseManager.requestProductData', productId, callback + '.success', callback + '.fail');
> When the arguments get to the native side there is an extra null value preceding the rest of the arguments. This is only a problem when the plugin expects the arguments to be in a certain order, like for InAppPurchaseManager. A workaround for InAppPurchaseManager is to increase the index by one for each call in the .m file (e.g. [arguments objectAtIndex:0] becomes [arguments objectAtIndex:1]).
> The extra null value is the callbackId, which is always going to be null using "FORMAT 2". The code that handles this was refactored since 2.0, which may be the source of the problem, in particular around line 959 of the current cordova.js:
>  var command = [callbackId, service, action, actionArgs];

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CB-1385) 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah reassigned CB-1385:
------------------------------------

    Assignee: Andrew Grieve  (was: Filip Maj)

Hi Andrew - assigning to you for comment.
                
> 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec
> -----------------------------------------------------------------------------------------------
>
>                 Key: CB-1385
>                 URL: https://issues.apache.org/jira/browse/CB-1385
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 2.1.0
>         Environment: iOS
>            Reporter: Matthew Windwer
>            Assignee: Andrew Grieve
>             Fix For: 2.1.0
>
>
> This was brought to my attention when the InAppPurchaseManager plugin no longer worked for me on 2.1.0rc2, but was working in 2.0.
> The issue happens when calling cordova.exec using "FORMAT TWO", e.g:
> cordova.exec('InAppPurchaseManager.requestProductData', productId, callback + '.success', callback + '.fail');
> When the arguments get to the native side there is an extra null value preceding the rest of the arguments. This is only a problem when the plugin expects the arguments to be in a certain order, like for InAppPurchaseManager. A workaround for InAppPurchaseManager is to increase the index by one for each call in the .m file (e.g. [arguments objectAtIndex:0] becomes [arguments objectAtIndex:1]).
> The extra null value is the callbackId, which is always going to be null using "FORMAT 2". The code that handles this was refactored since 2.0, which may be the source of the problem, in particular around line 959 of the current cordova.js:
>  var command = [callbackId, service, action, actionArgs];

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1385) 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13451955#comment-13451955 ] 

Andrew Grieve commented on CB-1385:
-----------------------------------

Hmm, yes, thanks Matthew for figuring out what went wrong here. I think what we could do to fix this is to pop off the null callbackId in CDVInvokedUrlCommand::legacyArguments if it is null/nil.

Shaz - We're away today at a company golf off-site. I will fix this tomorrow, but since it's a 2.1 blocker, feel free to take it as well.
                
> 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec
> -----------------------------------------------------------------------------------------------
>
>                 Key: CB-1385
>                 URL: https://issues.apache.org/jira/browse/CB-1385
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 2.1.0
>         Environment: iOS
>            Reporter: Matthew Windwer
>            Assignee: Andrew Grieve
>             Fix For: 2.1.0
>
>
> This was brought to my attention when the InAppPurchaseManager plugin no longer worked for me on 2.1.0rc2, but was working in 2.0.
> The issue happens when calling cordova.exec using "FORMAT TWO", e.g:
> cordova.exec('InAppPurchaseManager.requestProductData', productId, callback + '.success', callback + '.fail');
> When the arguments get to the native side there is an extra null value preceding the rest of the arguments. This is only a problem when the plugin expects the arguments to be in a certain order, like for InAppPurchaseManager. A workaround for InAppPurchaseManager is to increase the index by one for each call in the .m file (e.g. [arguments objectAtIndex:0] becomes [arguments objectAtIndex:1]).
> The extra null value is the callbackId, which is always going to be null using "FORMAT 2". The code that handles this was refactored since 2.0, which may be the source of the problem, in particular around line 959 of the current cordova.js:
>  var command = [callbackId, service, action, actionArgs];

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CB-1385) 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Grieve reassigned CB-1385:
---------------------------------

    Assignee: Andrew Grieve  (was: Shazron Abdullah)
    
> 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec
> -----------------------------------------------------------------------------------------------
>
>                 Key: CB-1385
>                 URL: https://issues.apache.org/jira/browse/CB-1385
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 2.1.0
>         Environment: iOS
>            Reporter: Matthew Windwer
>            Assignee: Andrew Grieve
>             Fix For: 2.1.0
>
>
> This was brought to my attention when the InAppPurchaseManager plugin no longer worked for me on 2.1.0rc2, but was working in 2.0.
> The issue happens when calling cordova.exec using "FORMAT TWO", e.g:
> cordova.exec('InAppPurchaseManager.requestProductData', productId, callback + '.success', callback + '.fail');
> When the arguments get to the native side there is an extra null value preceding the rest of the arguments. This is only a problem when the plugin expects the arguments to be in a certain order, like for InAppPurchaseManager. A workaround for InAppPurchaseManager is to increase the index by one for each call in the .m file (e.g. [arguments objectAtIndex:0] becomes [arguments objectAtIndex:1]).
> The extra null value is the callbackId, which is always going to be null using "FORMAT 2". The code that handles this was refactored since 2.0, which may be the source of the problem, in particular around line 959 of the current cordova.js:
>  var command = [callbackId, service, action, actionArgs];

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CB-1385) 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec

Posted by "Shazron Abdullah (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shazron Abdullah reassigned CB-1385:
------------------------------------

    Assignee: Shazron Abdullah  (was: Andrew Grieve)
    
> 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec
> -----------------------------------------------------------------------------------------------
>
>                 Key: CB-1385
>                 URL: https://issues.apache.org/jira/browse/CB-1385
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 2.1.0
>         Environment: iOS
>            Reporter: Matthew Windwer
>            Assignee: Shazron Abdullah
>             Fix For: 2.1.0
>
>
> This was brought to my attention when the InAppPurchaseManager plugin no longer worked for me on 2.1.0rc2, but was working in 2.0.
> The issue happens when calling cordova.exec using "FORMAT TWO", e.g:
> cordova.exec('InAppPurchaseManager.requestProductData', productId, callback + '.success', callback + '.fail');
> When the arguments get to the native side there is an extra null value preceding the rest of the arguments. This is only a problem when the plugin expects the arguments to be in a certain order, like for InAppPurchaseManager. A workaround for InAppPurchaseManager is to increase the index by one for each call in the .m file (e.g. [arguments objectAtIndex:0] becomes [arguments objectAtIndex:1]).
> The extra null value is the callbackId, which is always going to be null using "FORMAT 2". The code that handles this was refactored since 2.0, which may be the source of the problem, in particular around line 959 of the current cordova.js:
>  var command = [callbackId, service, action, actionArgs];

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CB-1385) 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec

Posted by "Andrew Grieve (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CB-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452244#comment-13452244 ] 

Andrew Grieve commented on CB-1385:
-----------------------------------

I'm back early - so I'll fix this up asap.
                
> 2.1.0rc2 breaks certain plugins on iOS due to added "null" argument using FORMAT TWO in iOSExec
> -----------------------------------------------------------------------------------------------
>
>                 Key: CB-1385
>                 URL: https://issues.apache.org/jira/browse/CB-1385
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaJS, iOS
>    Affects Versions: 2.1.0
>         Environment: iOS
>            Reporter: Matthew Windwer
>            Assignee: Andrew Grieve
>             Fix For: 2.1.0
>
>
> This was brought to my attention when the InAppPurchaseManager plugin no longer worked for me on 2.1.0rc2, but was working in 2.0.
> The issue happens when calling cordova.exec using "FORMAT TWO", e.g:
> cordova.exec('InAppPurchaseManager.requestProductData', productId, callback + '.success', callback + '.fail');
> When the arguments get to the native side there is an extra null value preceding the rest of the arguments. This is only a problem when the plugin expects the arguments to be in a certain order, like for InAppPurchaseManager. A workaround for InAppPurchaseManager is to increase the index by one for each call in the .m file (e.g. [arguments objectAtIndex:0] becomes [arguments objectAtIndex:1]).
> The extra null value is the callbackId, which is always going to be null using "FORMAT 2". The code that handles this was refactored since 2.0, which may be the source of the problem, in particular around line 959 of the current cordova.js:
>  var command = [callbackId, service, action, actionArgs];

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira