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

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

Github user robpaveza commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/228#discussion_r36766569
  
    --- Diff: cordova-lib/src/plugman/fetch.js ---
    @@ -146,11 +145,7 @@ function fetchPlugin(plugin_src, plugins_dir, options) 
{
             });
         }).then(function(result){
             checkID(options.expected_id, result.pinfo);
    -        var data = { source: result.fetchJsonSource };
    -        data.is_top_level = options.is_top_level; 
    -        data.variables = options.variables || {};
    -        metadata.save_fetch_metadata(plugins_dir, result.pinfo.id, data);
    -        return result.dest;
    +        return result;
    --- End diff --
    
    Function name `checkID` seems to do something and return a result, but you 
don't capture that result, nor do you return anything with that result.  
Because you pass the value of `result.pinfo` by value, `checkID` has no 
opportunity to mutate or modify anything.
    
    What happens if `checkID` "fails", if it can?  If it can't, why is it 
called `check`?


> 'cordova plugin add git_url' erroneously updates fetch.json even when the 
> 'add operation fails'
> -----------------------------------------------------------------------------------------------
>
>                 Key: CB-8627
>                 URL: https://issues.apache.org/jira/browse/CB-8627
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CLI
>            Reporter: Omar Mefire
>            Assignee: Omar Mefire
>
> - cordova plugin add https://github.com/Wizcorp/phonegap-facebook-plugin.git
>     This results in fetch.json being updated with the plugin info even though 
> the plugin installation failed. It should not be the case.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to