Apache Cordova
  1. Apache Cordova
  2. CB-385

Implement checking of platform + version in cordova-js to values returned in native device information

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.5.0, 1.6.0, 1.6.1, 1.7.0
    • Fix Version/s: None
    • Component/s: CordovaJS
    • Labels:
      None

      Description

      There still exists a lot of confusion regarding utilizing the wrong .js file for a given platform. Many people still think that the cordova.js file can be reused across platforms.

      We should implement a check in cordova-js, comparing with some tokens that get replaced in the JS at build-time, that verify the version and platform that the .js file is built for matches what the native framework returns. IF it doesn't we can alert the user of the issue and hopefully avoid a lot of headache for users who are unaware.

        Activity

        Hide
        Filip Maj added a comment -

        Moved to 1.8.0: making sure 1.7.0 is a bug fix and docs polish release, not a new feature release.

        Show
        Filip Maj added a comment - Moved to 1.8.0: making sure 1.7.0 is a bug fix and docs polish release, not a new feature release.
        Hide
        Filip Maj added a comment -

        One avenue for a solution for this issue is to check the values of the device module's platform and cordova properties and compare against the platform module's id property (inside the platform.js file), and perhaps another token that we inject with the contents of the VERSION file at build-time. This, however, relies on the bridge working (since we need the device info to come back), which may (and probably will) not work if the wrong cordova.js file is used.

        Anyone have thoughts on that?

        Show
        Filip Maj added a comment - One avenue for a solution for this issue is to check the values of the device module's platform and cordova properties and compare against the platform module's id property (inside the platform.js file), and perhaps another token that we inject with the contents of the VERSION file at build-time. This, however, relies on the bridge working (since we need the device info to come back), which may (and probably will) not work if the wrong cordova.js file is used. Anyone have thoughts on that?
        Hide
        Filip Maj added a comment -

        Going to investigate:

        • adding a marker near the top (comment for users, and some token in the platform defn file)
        • try to compare against user agent string (shudder).
        Show
        Filip Maj added a comment - Going to investigate: adding a marker near the top (comment for users, and some token in the platform defn file) try to compare against user agent string (shudder).
        Hide
        Filip Maj added a comment -

        Removing a fix version for this issue and dropping priority. Still need a bunch of investigation/research to see if/how this is doable.

        Show
        Filip Maj added a comment - Removing a fix version for this issue and dropping priority. Still need a bunch of investigation/research to see if/how this is doable.
        Hide
        Filip Maj added a comment -

        Probably will not fix / implement this.

        Show
        Filip Maj added a comment - Probably will not fix / implement this.

          People

          • Assignee:
            Filip Maj
            Reporter:
            Filip Maj
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development