[
https://issues.apache.org/jira/browse/CB-11174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15263941#comment-15263941
]
ASF GitHub Bot commented on CB-11174:
-------------------------------------
GitHub user vladimir-kotikov opened a pull request:
https://github.com/apache/cordova-lib/pull/433
CB-11174 Resolve symlinked path before getting PlatformApi instance
This PR the issue when `getPlatformApi` method in cordova-lib returns a
different instances for two paths pointing to the same destination, This also
fixes 'npm test' failures on OS X.
See JIRA [CB-11174](https://issues.apache.org/jira/browse/CB-11174) for
background and details.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/MSOpenTech/cordova-lib CB-11174
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-lib/pull/433.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 #433
----
commit e2380dc0bb370980311a0001a738654046f36630
Author: Vladimir Kotikov <[email protected]>
Date: 2016-04-29T09:23:29Z
CB-11174 Resolve symlinked path before getting PlatformApi instance
----
> cordova platformApi cache isn't dealing correctly with symlinked project dirs
> -----------------------------------------------------------------------------
>
> Key: CB-11174
> URL: https://issues.apache.org/jira/browse/CB-11174
> Project: Apache Cordova
> Issue Type: Bug
> Components: CordovaLib
> Affects Versions: 6.1.1
> Reporter: Vladimir Kotikov
> Assignee: Vladimir Kotikov
>
> When project dir is inside of symlinked directory (say {{/var}} on OS X),
> {{getPlatformApi}} method in cordova-lib doesn't resolve real path before
> dealing with cache and uses provided path as-is. This causes returning two
> separate instances of {{PlatformApi}} class when {{getPlatformApi}} is first
> called with symlinked path and then with real one, despite of the fact that
> both paths are pointing to the same project.
> In the real life this issue causes the following 'npm test' failures for
> cordova-lib on OS X, caused by mocking methods for one PlatformApi instance
> and using another one:
> {noformat}
> 1) plugin end-to-end should not run prepare after plugin
> installation/removal if platform return non-falsy value
> Message:
> Expected spy preparePlatforms not to have been called.
> Stacktrace:
> Error: Expected spy preparePlatforms not to have been called.
> at
> /Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/spec-cordova/plugin.spec.js:175:50
> at _fulfilled
> (/Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/node_modules/q/q.js:787:54)
> at self.promiseDispatch.done
> (/Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/node_modules/q/q.js:816:30)
> at Promise.promise.promiseDispatch
> (/Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/node_modules/q/q.js:749:13)
> at
> /Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/node_modules/q/q.js:557:44
> at flush
> (/Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/node_modules/q/q.js:108:17)
> at nextTickCallbackWith0Args (node.js:419:9)
> at process._tickCallback (node.js:348:13)
>
> 2) plugin end-to-end should not run prepare after plugin
> installation/removal if platform return non-falsy value
> Message:
> Expected spy preparePlatforms not to have been called.
> Stacktrace:
> Error: Expected spy preparePlatforms not to have been called.
> at
> /Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/spec-cordova/plugin.spec.js:179:50
> at _fulfilled
> (/Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/node_modules/q/q.js:787:54)
> at self.promiseDispatch.done
> (/Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/node_modules/q/q.js:816:30)
> at Promise.promise.promiseDispatch
> (/Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/node_modules/q/q.js:749:13)
> at
> /Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/node_modules/q/q.js:557:44
> at flush
> (/Users/csantana23/Documents/dev/cordova/cordova-lib/cordova-lib/node_modules/q/q.js:108:17)
> at nextTickCallbackWith0Args (node.js:419:9)
> at process._tickCallback (node.js:348:13)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]