cordova-plugin-code-push icon indicating copy to clipboard operation
cordova-plugin-code-push copied to clipboard

Rollback to the old version when restart the app

Open chy89310 opened this issue 7 years ago • 7 comments

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Description

I run a tabs demo project with ionic 4 and set up the codePush properly. After a new release upload to the codePush, app prompt up the update dialog as expect. And new layout update once install new version. But the layout rollback to old one when I kill the app and relaunch.

Reproduction

  1. ionic start myApp tabs
  2. install cordova-plugin-code-push and config deploy key
  3. call sync function in app.component.ts
this.platform.ready().then(() => {
      // Code push callback
      this.codePush.sync({
        updateDialog: true,
        installMode: InstallMode.IMMEDIATE
      }, (downloadProgress => {
        console.log('downloading: ' + downloadProgress);
      })).subscribe(syncStatus => {
        console.log('syncStatus: ' + syncStatus);
      });
    });
  1. ionic cordova run ios in device.

  2. add a new tab in the home page.

  3. code-push release-cordova TabsDemo_ios ios

  4. app prompt up the update dialog and click install. Layout update with an additional tab once after install new version.

  5. quit the app and relaunch it. Additional tab disappear.

Additional Information

  • cordova-plugin-code-push version: 1.11.17
  • List of installed plugins:
    • code-push 2.0.6 "CodePushAcquisition"
    • cordova-plugin-code-push 1.11.17 "CodePush"
    • cordova-plugin-device 2.0.2 "Device"
    • cordova-plugin-dialogs 2.0.1 "Notification"
    • cordova-plugin-file 6.0.1 "File"
    • cordova-plugin-file-transfer 1.7.1 "File Transfer"
    • cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
    • cordova-plugin-ionic-webview 3.1.2 "cordova-plugin-ionic-webview"
    • cordova-plugin-splashscreen 5.0.2 "Splashscreen"
    • cordova-plugin-statusbar 2.4.2 "StatusBar"
    • cordova-plugin-whitelist 1.3.3 "Whitelist"
    • cordova-plugin-zip 3.1.0 "cordova-plugin-zip"
  • Cordova version: 8.1.2
  • iOS/Android/Windows version: ios 4.5.5
  • Does this reproduce on a debug build or release build?
    • only debug build tested
  • Does this reproduce on a simulator, or only on a physical device?
    • both simulator and device

chy89310 avatar Apr 16 '19 07:04 chy89310

You can try:

    // Calling this function is required during the first application run after an update.
    // If not called, the application will be reverted to the previous version.
    window.codePush.notifyApplicationReady();

InformaticaComergrup avatar Apr 18 '19 10:04 InformaticaComergrup

Hi @chy89310, Thanks for reporting!

Yeah, that is known issue. Here is issue for that: https://github.com/Microsoft/cordova-plugin-code-push/issues/498 Could you please check it and ensure that this is the same issue or not? As workaround you can use 1.11.15 version of cordova-plugin-code-push. Also, Here is PR for fixing this issue: https://github.com/Microsoft/cordova-plugin-code-push/pull/520

Please feel free to ask any questions.

alexandergoncharov-zz avatar Apr 18 '19 12:04 alexandergoncharov-zz

@alexandergoncharov thanks for reply, but either way seems not work for me.

chy89310 avatar Apr 23 '19 03:04 chy89310

@chy89310 , oh, yeah, could you please also update code-push plugin to lates version as it has fix for ionic4?

Just run:

ionic cordova plugin rm cordova-plugin-code-push
ionic cordova platform rm ios
ionic cordova platform add ios
ionic cordova plugin add cordova-plugin-code-push@latest

Please let me know if it was helpful or issue is still here.

alexandergoncharov-zz avatar Apr 23 '19 09:04 alexandergoncharov-zz

Hi, I had the same issue as described. I can confirm that the issue disappeared when i upgrade to v 1.11.18

Christianuchermannuc avatar Apr 30 '19 12:04 Christianuchermannuc

@alexandergoncharov since I using ionic 3, when I change the @ionic-native/code-push plugin to version 4.20.0, everything works as expect. Thank you for your help again!

chy89310 avatar May 09 '19 01:05 chy89310

this.codePush.sync(); without any parm works for me

mohamedsharaf avatar Jan 29 '20 14:01 mohamedsharaf