React-native-code-push: what it means? `An update is available, but it is being ignored due to having been previously rolled back`

Created on 22 Sep 2016  路  8Comments  路  Source: microsoft/react-native-code-push

(android)An update is available, but it is being ignored due to having been previously rolled back
What does that means? What's wrong? How could I reinstall the updated? It seems that I must be clear the app's data, then install it successful.

Most helpful comment

This is similar to #696 but I will address it here in case the root cause is different.

@rt2zz, @silentcoast, are you wrapping your root component like this: https://github.com/Microsoft/react-native-code-push#plugin-usage?

To clarify - CodePush has a notifyAppReady() function that needs to be called when an update is loaded successfully, that marks the update as 'successful'. If this is not called at some point in the first run of an update, it will be rolled back the next time the app restarts. We recommend just calling this in your componentDidMount(). Actually, the wrapper above will just do that for you, so that you technically don't need to know about this at all.

(As an alternative, CodePush.sync() also calls notifyAppReady() internally, but you may not be calling sync() on every run of your app)

Does this help?

All 8 comments

@sopaco: CodePush has a rollback feature that protects you from bad updates - if CodePush is not called in the first run of an update, the CodePush SDK will assume that it has crashed, and undo the update the next time the app is restarted. That update will also be 'black-listed', so that it won't be applied again.

Does this make sense to you? If you run code-push deployment history <appName> <deploymentName> from the CLI, what do you see?

As for why your app is rolling back, can you show me how you're calling CodePush?

@sopaco, did you still need help with this?

@silhouettes I am seeing the same issue. Specifically:

  • run code push release
  • first open of app successfully updates
  • second run on different phone does not update, nor do any other syncs from here out
  • jumping into the logs I see An update is available, but it is being ignored due to having been previously rolled back

What would cause the first sync to work and not subsequent? What do you mean by if CodePush is not called in the first run of an update should we be calling some method in code push when the app loads?

Running into the same issue. Update runs and it downloads the new files. Restarts the app and everything is fine. But when I close the app and re-open it gives the error about it being rolled back and shows the original files. This is happening on both Android and iOS

This is similar to #696 but I will address it here in case the root cause is different.

@rt2zz, @silentcoast, are you wrapping your root component like this: https://github.com/Microsoft/react-native-code-push#plugin-usage?

To clarify - CodePush has a notifyAppReady() function that needs to be called when an update is loaded successfully, that marks the update as 'successful'. If this is not called at some point in the first run of an update, it will be rolled back the next time the app restarts. We recommend just calling this in your componentDidMount(). Actually, the wrapper above will just do that for you, so that you technically don't need to know about this at all.

(As an alternative, CodePush.sync() also calls notifyAppReady() internally, but you may not be calling sync() on every run of your app)

Does this help?

@silhouettes I completely overlooked that section in the documentation. I added it and worked as expected.

I am still facing this issue. I have wrapped my component the way it was supposed to be wrapped. Below is my index.js file

import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
import codePush from "react-native-code-push";
import bgMessaging from "./src/appComponents/notification/bgMessaging";

const codePushOptions = {
    checkFrequency: codePush.CheckFrequency.ON_APP_START
}

AppRegistry.registerComponent(appName, () => codePush(codePushOptions)(App));

same issue in android and working fine in ios.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diegocouto picture diegocouto  路  4Comments

DeDuckProject picture DeDuckProject  路  3Comments

sergey-akhalkov picture sergey-akhalkov  路  4Comments

EdmundMai picture EdmundMai  路  4Comments

fanzhiri picture fanzhiri  路  3Comments