microsoft / react-native-code-push

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

Codepush Trying To Sync On Startup Unnecessarily In Android #2422

Closed niftytyro closed 1 year ago

niftytyro commented 1 year ago

Steps to Reproduce

  1. Setup Codepush In React Native App.
  2. In strings.xml, give a random deployment key, in my case - 'This is set in JS'
  3. Pass the deployment key in codepush options, and set checkFrequency to MANUAL.
  4. Call sync() with the appropriate deployment key at a later stage in the app.
  5. Run app and monitor network.

Expected Behavior

It should make a network call to check for updates where sync() is called.

Actual Behavior

It makes multiple network calls. One call is made at a later stage where sync() is defined and uses the correct deployment key. But initially, 2 extra network calls are made to https://codepush.appcenter.ms/v0.1/public/codepush/report_status/deploy with the wrong deployment key. They use the 'This is set in JS' deployment key instead of the one set in codepush options in JS. This means that these calls are probably being made before even my RN activity boots up. So I have 2 questions:

  1. What is the purpose of these network calls? Are they really necessary?
  2. And why are they being made in Android, while I see no such calls in iOS?

Environment

ko-devHong commented 1 year ago

why different use codepushKey ??

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

microsoft-github-policy-service[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

microsoft-github-policy-service[bot] commented 1 year ago

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.

microsoft-github-policy-service[bot] commented 1 year ago

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.