Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11174

cordova platformApi cache isn't dealing correctly with symlinked project dirs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.1.1
    • None
    • cordova-lib

    Description

      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:

        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)
      

      Attachments

        Issue Links

          Activity

            People

              vladimir.kotikov Vladimir Kotikov
              vladimir.kotikov Vladimir Kotikov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: