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.

getUpdateMetadata gives false package with DEBUG build #672

@adbl

Description

@adbl

Running a DEBUG build in simulator (and probably on device too), using this in AppDelegate.m:

 #ifdef DEBUG
  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
#else
  jsCodeLocation = [CodePush bundleURL];
#endif

which should make it impossible that a Code Push update gets loaded?

  1. The first run this works as expected, codePush.getUpdateMetadata() returns null.
  2. During this run, Code Push detected, downloaded and installed an update.
  3. During next launch, codePush.getUpdateMetadata() now gives the package that was downloaded, however it clearly isn't running. It's running the dev bundle from packager.

This had me extremely confused until I figured out that it wasn't actually running the update. It seems like getUpdateMetadata doesn't understand that an "installed" package may not be running, due to the CodePush bundle loader was not in use.

  • react-native-code-push version: 1.16.1-beta
  • react-native version: 0.36.1
  • iOS/Android/Windows version: iOS 10.2
  • Does this reproduce on a debug build or release build? deug
  • Does this reproduce on a simulator, or only on a physical device? Simulator (both?)

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