Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

[CodePush] Update is rolling back after app relaunch #680

@jomedell

Description

@jomedell

Description

User is trying to create custom UI when an update is available, it is working as expected at the first launch. But, when user kills the app and relaunches it, again it says an update is available. Meaning, after the successful update, the app is not able to set that installed update as successful and it is rollingback the update in the next launch.

Error: An update is available, but it is being ignored due to have been previously rolled back

Reproduction

  1. Run the app on simulator
  2. Can see the update prompt.
  3. Click on continue.
  4. It installs and refreshes the app -> can see the update.
  5. Kill the app and relaunch.
  6. Issue exists here. The install update is gone and it shows the previous version of the app.

They are calling the codePush.notifyApplicationReady(); event in platform.ready function.
Also, tried using codepush.sync() when the update available. That also didn't help.

Please check the below logs:

Update & App Refresh:

2021-07-02 17:50:08.610185-0400 MyApp[19399:3529231] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/vpatnana001/Library/Developer/CoreSimulator/Devices/78324386-BF85-4745-AAFA-5AD2828FB0A7/data/Containers/Data/Application/6B541FC3-E134-4DE7-965C-92542DA6E743/Library/Cookies/io.ionic.starter.binarycookies 021-07-02 17:50:08.619113-0400 MyApp[19399:3529231] Apache Cordova native platform version 5.1.1 is starting. 2021-07-02 17:50:08.619338-0400 MyApp[19399:3529231] Multi-tasking -> Device: YES, App: YES 2021-07-02 17:50:08.631256-0400 MyApp[19399:3529231] CDVWKWebViewEngine: trying to inject XHR polyfill 2021-07-02 17:50:08.787807-0400 MyApp[19399:3529231] CDVWKWebViewEngine will reload WKWebView if required on resume 2021-07-02 17:50:08.788223-0400 MyApp[19399:3529231] Using Ionic WKWebView 2021-07-02 17:50:08.788541-0400 MyApp[19399:3529231] [CDVTimer][console] 0.052929ms 2021-07-02 17:50:08.788727-0400 MyApp[19399:3529231] [CDVTimer][handleopenurl] 0.048995ms 2021-07-02 17:50:08.789876-0400 MyApp[19399:3529231] [CDVTimer][intentandnavigationfilter] 1.054049ms 2021-07-02 17:50:08.790031-0400 MyApp[19399:3529231] [CDVTimer][gesturehandler] 0.045061ms 2021-07-02 17:50:08.791419-0400 MyApp[19399:3529231] [CDVTimer][file] 1.307964ms 2021-07-02 17:50:08.791893-0400 MyApp[19399:3529231] [CDVTimer][codepush] 0.353932ms 2021-07-02 17:50:08.792110-0400 MyApp[19399:3529231] CDVIonicKeyboard: resize mode 1 2021-07-02 17:50:08.792443-0400 MyApp[19399:3529231] [CDVTimer][cdvionickeyboard] 0.455022ms 2021-07-02 17:50:08.800892-0400 MyApp[19399:3529231] [CDVTimer][splashscreen] 8.342028ms 2021-07-02 17:50:08.802628-0400 MyApp[19399:3529231] [CDVTimer][statusbar] 1.551986ms 2021-07-02 17:50:08.802771-0400 MyApp[19399:3529231] [CDVTimer][TotalPluginStartup] 14.325976ms 2021-07-02 17:50:09.249247-0400 MyApp[19399:3529231] WF: === Starting WebFilter logging for process MyApp 2021-07-02 17:50:09.249391-0400 MyApp[19399:3529231] WF: _userSettingsForUser : (null) 2021-07-02 17:50:09.249547-0400 MyApp[19399:3529231] WF: _WebFilterIsActive returning: NO 2021-07-02 17:50:09.250166-0400 MyApp[19399:3529231] WF: _userSettingsForUser : (null) 2021-07-02 17:50:09.250264-0400 MyApp[19399:3529231] WF: _WebFilterIsActive returning: NO 2021-07-02 17:50:09.830754-0400 MyApp[19399:3529231] Ionic Native: deviceready event fired after 301 ms 2021-07-02 17:50:09.832303-0400 MyApp[19399:3529231] CODE PUSH SUCCESSFUL: 5 2021-07-02 17:50:10.053856-0400 MyApp[19399:3529372] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed 2021-07-02 17:50:10.322868-0400 MyApp[19399:3529231] [CodePush] Reported status: {"status":0,"appVersion":"0.0.1","deploymentKey":"OWnGHrTM3eGJVqH2rG3WGstqUx1gAsvfVh8_i","previousLabelOrAppVersion":null,"previousDeploymentKey":null} 2021-07-02 17:50:10.688317-0400 MyApp[19399:3529231] [CodePush] Checking for update. 2021-07-02 17:50:10.913365-0400 MyApp[19399:3529231] [CodePush] An update is available. {"isDownloading":false,"appVersion":"0.0.1","deploymentKey":"OWnGHrTM3eGJVqH2rG3WGstqUx1gAsvfVh8_i","description":"testing app code","downloadUrl":"https://codepushupdates.azureedge.net/storagev2/D6fe-0Wuh9Q5fYLVcKEvxDF1V7NK6250f84d-77ee-4c32-9a09-31bd8ba07261","isMandatory":true,"label":"v3","packageHash":"9bc8c79a70a745c3870e874feb0edbf98a7a5f05891513deb8dc91da4c03609e","packageSize":3433920,"failedInstall":false} 2021-07-02 17:50:10.913520-0400 MyApp[19399:3529231] [CodePush] Awaiting user action. 2021-07-02 17:50:10.913642-0400 MyApp[19399:3529231] CODE PUSH SUCCESSFUL: 6 2021-07-02 17:50:10.927677-0400 MyApp[19399:3529231] THREAD WARNING: ['Notification'] took '13.881836' ms. Plugin should use a background thread. 2021-07-02 17:50:13.493780-0400 MyApp[19399:3529231] CODE PUSH SUCCESSFUL: 7 2021-07-02 17:50:13.494084-0400 MyApp[19399:3529231] [CodePush] Downloading update 2021-07-02 17:50:14.104131-0400 MyApp[19399:3529231] [CodePush] Package download success: {"deploymentKey":"OWnGHrTM3eGJVqH2rG3WGstqUx1gAsvfVh8_i","description":"testing app code","label":"v3","appVersion":"0.0.1","isMandatory":true,"packageHash":"9bc8c79a70a745c3870e874feb0edbf98a7a5f05891513deb8dc91da4c03609e","isFirstRun":false,"failedInstall":false,"localPath":"cdvfile://localhost/library-nosync/codepush/download/update.zip"} 2021-07-02 17:50:14.106247-0400 MyApp[19399:3529231] CODE PUSH SUCCESSFUL: 8 2021-07-02 17:50:14.106455-0400 MyApp[19399:3529231] [CodePush] Installing update 2021-07-02 17:50:18.969545-0400 MyApp[19399:3529231] [CodePush] Applying full update 2021-07-02 17:50:18.992594-0400 MyApp[19399:3529231] [CodePush] Install succeeded. 2021-07-02 17:50:18.992893-0400 MyApp[19399:3529231] CODE PUSH SUCCESSFUL: 1 2021-07-02 17:50:18.994423-0400 MyApp[19399:3529231] WF: _userSettingsForUser : (null) 2021-07-02 17:50:18.994512-0400 MyApp[19399:3529231] WF: _WebFilterIsActive returning: NO 2021-07-02 17:50:19.195786-0400 MyApp[19399:3529231] Ionic Native: deviceready event fired after 131 ms 2021-07-02 17:50:19.237154-0400 MyApp[19399:3529231] [CodePush] Checking for update. 2021-07-02 17:50:19.465684-0400 MyApp[19399:3529231] [CodePush] App is up to date. 2021-07-02 17:50:19.465873-0400 MyApp[19399:3529231] santosh checking for update null 2021-07-02 17:50:19.466006-0400 MyApp[19399:3529231] santosh The app is up to date.

At the next launch :

2021-07-02 18:01:29.218160-0400 MyApp[24323:3559383] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/vpatnana001/Library/Developer/CoreSimulator/Devices/78324386-BF85-4745-AAFA-5AD2828FB0A7/data/Containers/Data/Application/64C066DB-D044-4A57-9242-CFEA0621A7A3/Library/Cookies/io.ionic.starter.binarycookies 2021-07-02 18:01:29.226297-0400 MyApp[24323:3559383] Apache Cordova native platform version 5.1.1 is starting. 2021-07-02 18:01:29.226525-0400 MyApp[24323:3559383] Multi-tasking -> Device: YES, App: YES 2021-07-02 18:01:29.234902-0400 MyApp[24323:3559383] CDVWKWebViewEngine: trying to inject XHR polyfill 2021-07-02 18:01:29.385668-0400 MyApp[24323:3559383] CDVWKWebViewEngine will reload WKWebView if required on resume 2021-07-02 18:01:29.386223-0400 MyApp[24323:3559383] Using Ionic WKWebView 2021-07-02 18:01:29.386487-0400 MyApp[24323:3559383] [CDVTimer][console] 0.048041ms 2021-07-02 18:01:29.386662-0400 MyApp[24323:3559383] [CDVTimer][handleopenurl] 0.043988ms 2021-07-02 18:01:29.387874-0400 MyApp[24323:3559383] [CDVTimer][intentandnavigationfilter] 1.116991ms 2021-07-02 18:01:29.388045-0400 MyApp[24323:3559383] [CDVTimer][gesturehandler] 0.041008ms 2021-07-02 18:01:29.429134-0400 MyApp[24323:3559383] [CDVTimer][file] 40.989995ms 2021-07-02 18:01:32.840242-0400 MyApp[24323:3559383] [CDVTimer][codepush] 3410.966039ms 2021-07-02 18:01:32.840579-0400 MyApp[24323:3559383] CDVIonicKeyboard: resize mode 1 2021-07-02 18:01:32.841059-0400 MyApp[24323:3559383] [CDVTimer][cdvionickeyboard] 0.600934ms 2021-07-02 18:01:32.846578-0400 MyApp[24323:3559383] [CDVTimer][splashscreen] 5.396962ms 2021-07-02 18:01:32.847897-0400 MyApp[24323:3559383] [CDVTimer][statusbar] 1.194000ms 2021-07-02 18:01:32.848000-0400 MyApp[24323:3559383] [CDVTimer][TotalPluginStartup] 3461.588025ms 2021-07-02 18:01:33.070179-0400 MyApp[24323:3559383] WF: === Starting WebFilter logging for process MyApp 2021-07-02 18:01:33.070423-0400 MyApp[24323:3559383] WF: _userSettingsForUser : (null) 2021-07-02 18:01:33.070568-0400 MyApp[24323:3559383] WF: _WebFilterIsActive returning: NO 2021-07-02 18:01:33.071375-0400 MyApp[24323:3559383] WF: _userSettingsForUser : (null) 2021-07-02 18:01:33.071473-0400 MyApp[24323:3559383] WF: _WebFilterIsActive returning: NO 2021-07-02 18:01:33.732418-0400 MyApp[24323:3559383] Ionic Native: deviceready event fired after 302 ms 2021-07-02 18:01:33.830590-0400 MyApp[24323:3559536] [] nw_protocol_get_quic_image_block_invoke dlopen libquic failed 2021-07-02 18:01:33.837507-0400 MyApp[24323:3559383] [CodePush] Checking for update. 2021-07-02 18:01:34.101547-0400 MyApp[24323:3559383] [CodePush] Reported status: {"status":2,"label":"v3","appVersion":"0.0.1","deploymentKey":"OWnGHrTM3eGJVqH2rG3WGstqUx1gAsvfVh8_i","previousLabelOrAppVersion":"0.0.1","previousDeploymentKey":"OWnGHrTM3eGJVqH2rG3WGstqUx1gAsvfVh8_i"} 2021-07-02 18:01:34.212033-0400 MyApp[24323:3559383] [CodePush] An update is available. {"isDownloading":false,"appVersion":"0.0.1","deploymentKey":"OWnGHrTM3eGJVqH2rG3WGstqUx1gAsvfVh8_i","description":"testing app code","downloadUrl":"https://codepushupdates.azureedge.net/storagev2/D6fe-0Wuh9Q5fYLVcKEvxDF1V7NK6250f84d-77ee-4c32-9a09-31bd8ba07261","isMandatory":true,"label":"v3","packageHash":"9bc8c79a70a745c3870e874feb0edbf98a7a5f05891513deb8dc91da4c03609e","packageSize":3433920,"failedInstall":true} 2021-07-02 18:01:34.212278-0400 MyApp[24323:3559383] ---> checking for update {"isDownloading":false,"appVersion":"0.0.1","deploymentKey":"OWnGHrTM3eGJVqH2rG3WGstqUx1gAsvfVh8_i","description":"testing app code","downloadUrl":"https://codepushupdates.azureedge.net/storagev2/D6fe-0Wuh9Q5fYLVcKEvxDF1V7NK6250f84d-77ee-4c32-9a09-31bd8ba07261","isMandatory":true,"label":"v3","packageHash":"9bc8c79a70a745c3870e874feb0edbf98a7a5f05891513deb8dc91da4c03609e","packageSize":3433920,"failedInstall":true} 2021-07-02 18:01:34.212419-0400 MyApp[24323:3559383] ---> An update is available! Should we download it? 2021-07-02 18:01:34.217910-0400 MyApp[24323:3559383] CODE PUSH SUCCESSFUL: 5 2021-07-02 18:01:34.222277-0400 MyApp[24323:3559383] [CodePush] Checking for update. 2021-07-02 18:01:34.440903-0400 MyApp[24323:3559383] [CodePush] An update is available. {"isDownloading":false,"appVersion":"0.0.1","deploymentKey":"OWnGHrTM3eGJVqH2rG3WGstqUx1gAsvfVh8_i","description":"testing app code","downloadUrl":"https://codepushupdates.azureedge.net/storagev2/D6fe-0Wuh9Q5fYLVcKEvxDF1V7NK6250f84d-77ee-4c32-9a09-31bd8ba07261","isMandatory":true,"label":"v3","packageHash":"9bc8c79a70a745c3870e874feb0edbf98a7a5f05891513deb8dc91da4c03609e","packageSize":3433920,"failedInstall":true} 2021-07-02 18:01:34.441127-0400 MyApp[24323:3559383] [CodePush] An update is available, but it is being ignored due to have been previously rolled back. 2021-07-02 18:01:34.441233-0400 MyApp[24323:3559383] CODE PUSH SUCCESSFUL: 0

Additional Information

  • cordova-plugin-code-push version: 2.0.0
  • Cordova version: 5.1.1
  • Does this reproduce on a simulator, or only on a physical device? Simulator

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions