React-native-code-push: Code Push updates the app immediately.

Created on 20 Mar 2019  路  6Comments  路  Source: microsoft/react-native-code-push

Steps to Reproduce

  1. Open the React native starter install code push dependency.
  2. On App.js before exporting App component
  3. create a code push options
  4. export default App;

Expected Behavior

What did you expect to happen?
Code push should update the app after the user closes the App and restart manually. Then only the update will show up in the App.

# Actual Behavior

What actually happens?
It restarts the App immediately with update.

Reproducible Demo

  • Create an app via react-native install code push library via npm and link to the native project.
  • create a code push option and export the App
  • push the update in the terminal via staging deployment
  • open the app in a real device.
  • wait for the app to be updated

Environment

  • react-native-code-push version: 5.5.2
  • react-native version: 0.59.1
  • iOS/Android/Windows version: Android 7.0
  • Does this reproduce on a debug build or release build? release build on staging deployment
  • Does this reproduce on a simulator, or only on a physical device? Both

(The more info the faster we will be able to address it!)

class App extends Component {} App = codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_START, installMode: codePush.InstallMode.ON_NEXT_RESTART })(App); export default App;

android bug waiting-for-clarification

Most helpful comment

I found a way to tackle this problem
componentWillMount() { codePush.disallowRestart(); }

Adding this (App.js) will avoid force restart. Once User manually closes the App and start again the updated bundle will be shown up.

All 6 comments

Hi @ashokadichill,
Thanks for reporting!

That's strange. I just tested your case and all works correct for me.
Could you please share your logs during update?

Hi @ashokadichill,
Thanks for reporting!

That's strange. I just tested your case and all works correct for me.
Could you please share your logs during update?

I/ReactNativeJS: [CodePush] Checking for update.
I/ReactNativeJS: [CodePush] Reporting binary update (1.0)
I/ReactNativeJS: [CodePush] Downloading package.
D/ReactNative: [CodePush] Applying full update.
I/ReactNativeJS: [CodePush] Installing update.
D/ReactNative: [CodePush] Loading JS bundle from "/data/user/0/com.yyyy.yyyy/files/CodePush/secretkey/CodePush/index.android.bundle"
D/ReactNative: ReactInstanceManager.recreateReactContextInBackgroundInner()
I/ReactNativeJS: [CodePush] Restarting app

See This video for reference.
(https://drive.google.com/file/d/1RnPsftUh2YgwIZ-fRZraPuOcSyXvXMO-/view?usp=sharing)

I have the same problem (though I do not explicitly define installMode as I understand from the documentation that ON_NEXT_RESTART is the default).

Have you managed to resolve this?

@cubabit Still I don't have any solution to resolve this. I am depending on the Code Push team to look into it.

I found a way to tackle this problem
componentWillMount() { codePush.disallowRestart(); }

Adding this (App.js) will avoid force restart. Once User manually closes the App and start again the updated bundle will be shown up.

I found a way to tackle this problem
componentWillMount() { codePush.disallowRestart(); }

Adding this (App.js) will avoid force restart. Once User manually closes the App and start again the updated bundle will be shown up.

thanks this is solved my issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Phredward picture Phredward  路  3Comments

fanzhiri picture fanzhiri  路  3Comments

chrisjrex picture chrisjrex  路  4Comments

jaysig picture jaysig  路  3Comments

djw27 picture djw27  路  3Comments