Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Detect minor versions changes when copying www folder #66

Closed
hassellof opened this issue Dec 12, 2015 · 6 comments
Closed

Detect minor versions changes when copying www folder #66

hassellof opened this issue Dec 12, 2015 · 6 comments

Comments

@hassellof
Copy link
Contributor

Only checked this in iOS, not sure if this is the same on Android

Plugin only checks for major version changes when determining when to copy the www folder.

How to reproduce problem, lets assume that:

  1. Already have an install base of users with version 1.2.3
  2. We add a Cordova plugin and release version 1.3.0
  3. Users who had 1.2.3 installed will not get the Cordova plugin javascript files for version 1.3.0 without re-installing the app since cordova hcp only checks for major revisions (1.2.3 and 1.3.0 both have major revision 1).

Plugin also only installs www folder if major revision is larger than previous install, not if it's lower, which sometimes causes problems when going back and forward between test builds.

Suggested fixes:

  1. Use CFBundleShortVersionString to get the full version string when doing comparisons
  2. Install www folder when there is a difference of build versions of current and previous install, not only when it's larger. i.e. change
    BOOL isApplicationUpdated = [NSBundle applicationBuildVersion] > _pluginInternalPrefs.appBuildVersion;
    to
    BOOL isApplicationUpdated = [NSBundle applicationBuildVersion] != _pluginInternalPrefs.appBuildVersion;
    in HCPPlugin.m

Might submit a PR if I get more time to code this weekend. :)

@hassellof
Copy link
Contributor Author

Build number should be set to an Integer for plugin to work properly now. Does not need to be the same as what is displayed to customer (which our build server was currently doing). Guess that is OK, but needs better documentation.

Still believe we need to re-sync www folder on both upgrades and downgrades though, to not get odd bugs when testing older builds. Created a PR to fix this: #67

@nikDemyankov
Copy link
Member

We have talked with you a lot about that :) Still think that when you install older version of the app over the newer one - you should first delete the app from the device. But agree about the docs. Docs need more work, although there's already much info about build version.

Regarding PR - didn't think that someone would need that, that's why it's just checking if build version has increased. But don't see any problem in setting it to inequality.

@nikDemyankov
Copy link
Member

Merged PR.

@alexbuijs
Copy link
Contributor

@nikDemyankov I haven't investigated this, but won't this PR be a problem for the version numbering issue you talk about in the readme and that is discussed in #45? Because the Android versions will always be greater when build for separate architectures than the iOS version.

@nikDemyankov
Copy link
Member

@alexbuijs Haven't test it, but it shouldn't. That PR will reinstall www folder if build version has changed from the previous launch. It worked like that before, just checked if build version has increased.

@alexbuijs
Copy link
Contributor

Ok, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants