microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.92k stars 1.46k forks source link

Code push detecting updates at first app install even there's no release #2728

Closed mamoussa405 closed 3 weeks ago

mamoussa405 commented 1 month ago

Hello, I have encountered an issue after adding CodePush to my React Native app. CodePush detects updates after the first app installation, even though I haven't made any new releases. I compared the bundle in CodePush with the one in my APK and found no differences. What could be causing this problem?

Steps to Reproduce

  1. Push a release to CodePush for a specific environment.
  2. Build an APK for the same environment.
  3. Run the app

Expected Behavior

CodePush should not detect any updates.

Actual Behavior

CodePush detects new updates.

Environment

DordeDimitrijev commented 1 month ago

Hello @mamoussa405 thank you for reaching out. Bascially the scenario you mentioned is not an issue but rather the design of the codepush sdk. When you run your app after the fresh install the application itself just has knowledge that the update it fetched was never applied and thus it applies it even tough the changes might be the same. Please let me know if this helps out or if you have any addtional questions.

mamoussa405 commented 1 month ago

Thank you so much for responding Sir, is there any fix for that, i dont't want the users to get that there's updates at first install, thanks in advance.

DordeDimitrijev commented 1 month ago

I think this approach might do the trick for you. In app/build.gradle try to bump versionName. If you had versionName from codepush set to 1.0 try using in your local build 1.1. or 2.0 for versionName.

mamoussa405 commented 1 month ago

Do you mean that the app version should not match the exact version in codepush, it just needs to be in the target range?

DordeDimitrijev commented 1 month ago

build.gradle version must match binary tag version your provide otherwise it won't recognize the update. If you for example have update for binaryVersion 1.0 and you locally increment your build.gradle version to 1.1 it won't pickup those updates. If you wish to get updates also for that version you need to specify it when creating release. This is the only way since by design codepush will pickup any update that wasn't applied for specific version even if it has the same contents as in your scenario.

mamoussa405 commented 1 month ago

okay noted, thank you so much Sir.

DordeDimitrijev commented 3 weeks ago

Closing, as code-push is working according to design