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

[Android] Rollback + Binary update causes app to crash #921

@AndrewJack

Description

@AndrewJack

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

  1. Run the example app with InstallMode.ON_NEXT_RESTART
  2. Push a code push update that causes a rollback or don't call codePush.notifyAppReady() or sync
  3. Let the code push install
  4. Quit the app and remove from memory
  5. Open app
  6. Quit the app and remove from memory
  7. Install a new binary version
  8. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions