This repository was archived by the owner on May 20, 2025. It is now read-only.

Description
Description
initializeUpdateAfterRestart is called (in the constructor of CodePush) before getJSBundleFileInternal & clearUpdates. This can be confirmed by running the example app.
This causes the app to get into a unexpected state and crash when rolling back because the expected codepush.json status file has been deleted.
If a binary update has occurred the CodePush/ directory and settings are cleared. If the app has a pending update which has to be rolled back the app will crash because the necessary file have been deleted.
I will post a few stack traces captured by crashlytics, which are side effects of this core issue.
The use of headlessTask may be part of this issue. HeadlessTask only caused the rollbacks due to the absense of notifyAppReady
Reproduction
- Run the example app with
InstallMode.ON_NEXT_RESTART
- Push a code push update that causes a rollback or don't call
codePush.notifyAppReady() or sync
- Let the code push install
- Quit the app and remove from memory
- Open app
- Quit the app and remove from memory
- Install a new binary version
- Run the app
Actual:
Observe crash
Expected:
Should load binary version without crashing
Additional Information
- react-native-code-push version: 2.1.0
- react-native version: 0.44.2
- iOS/Android/Windows version: Android (any)
- Does this reproduce on a debug build or release build? release
- Does this reproduce on a simulator, or only on a physical device? either