Skip to content

CodePush updates download and install successfully but changes don't appear #36

@rohith-thummanapally-sidsfarm

Description

Environment

Platform: iOS
React Native version: 0.79.0
CodePush version: 1.4.0
CodePush service: Revopush
Device/Simulator: iOS Device (iPhone)
Build type: TestFlight (Release configuration)

Description
CodePush updates download, verify, and install successfully in Staging environment, but the changes don't appear in the app . The same setup works perfectly in Production environment.

CodePush Configuration:

function MainStack()
{

const codePushStatusDidChange = async (syncStatus) => {
    console.log('codepush' , syncStatus);
    if (syncStatus === codePush.SyncStatus.UPDATE_INSTALLED) {
     console.log('codepush updated to latest codepush');
    }
    else if(syncStatus === codePush.SyncStatus.DOWNLOADING_PACKAGE)
    {
      console.log('codepush Downloading package - JS');
    } 
    else if(syncStatus === codePush.SyncStatus.INSTALLING_UPDATE)
    {
      console.log('codepush INSTALLING_UPDATE - JS');
    }
  };

  const syncCodepushUpdate = async () => {
    try {
      await codePush.sync(
        {
          installMode: codePush.InstallMode.IMMEDIATE,
        },
        codePushStatusDidChange,
      );
    } catch (error) {
      console.log(error);
      crashlytics().recordError(error, 'Home-syncCodepushUpdate');
    }
  };

useEffect(()=>{
syncCodepushUpdate();
},[]);

//all of other logic
return (...//my screens);
}

export default codePush(MainStack);

Native Configuration (AppDelegate.swift)
override func bundleURL() -> URL? {
#if DEBUG
return RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
return CodePush.bundleURL()
#endif
}

Info.plist
CodePushDeploymentKey
[STAGING_DEPLOYMENT_KEY]

Steps to Reproduce

  1. Build app version for TestFlight (Release configuration)
  2. Install app on device from TestFlight
  3. Make simple text changes in a .js file (e.g., change "Hello" to "Hello World")
  4. Release update to Staging (do a codepush )
  5. Open app - CodePush sync is triggered
  6. Observe logs and app behavior

Expected Behavior

After CodePush update completes and app restarts, the text changes should be visible immediately.

Actual Behavior

  • Update downloads successfully
  • Hash verification passes
  • Update installs successfully
  • Logs show "Update is installed and will be run on the next app restart"
  • App restarts
  • Changes are NOT visible

After 2nd /3rd Restart of app

After Restart

codepush: App is up to date

Additional Information

codePush.getUpdateMetadata();
is giving

{ install: [Function: install],
isPending: false,
description: '',
label: 'v37',
failedInstall: false,
binaryDate: '1770835938.000000',
packageHash: 'e9922be8abc55a04a837eb20c043278e933a2bfb0e8d1fbccb5dfsomehash',
bundlePath: '.bundles/main.jsbundle',
isMandatory: true,
appVersion: '4.1.35',
downloadUrl: 'https://blob.revopush.org/diff_EJCVC2fnZx_6dHVSbzNIvRV3tdsTz-ncM-sAL4p4JOT',
packageSize: 1606455,
deploymentKey: 'My Deployment KEY',
isFirstRun: false }

i have downloaded the bundle from downloadUrl , my changes are there in bundle (BTW i am just testing for textual changes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions