React-native-code-push: SyncStatus updating incorrectly

Created on 21 Mar 2017  路  3Comments  路  Source: microsoft/react-native-code-push

Description

Setup: My app checks for new code push ON_APP_RESUME, and install updates ON_APP_RESTART.

const codePushOptions = {
  installMode: codePush.InstallMode.ON_NEXT_RESTART,
  checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
  mandatoryInstallMode: codePush.InstallMode.ON_NEXT_RESUME,
};

I'm using SyncStatus to display a message prompting users to restart the app, after a period of time has elapsed.

After SyncStatus correctly goes to UPDATE_INSTALLED, on the next resume I see it transition to CHECKING_FOR_UPDATE and then UP_TO_DATE, even though the update has not yet been installed. The next app restart will install the update, as normal.

Reproduction

Fresh app install with valid codepush key, etc. Logging sync status in console or in a element. status lands on UPDATE_INSTALLED. home screen -> click on app again, status is now 0 (aka UP_TO_DATE).

It seems like every time code push checks for a new update, it resets the state away from UPDATE_INSTALLED, even if an update is installed and pending restart. Additionally it looks like accepting new iOS permissions triggers a recheck, although I'm not 100% sure of that.

Additional Information

  • react-native-code-push version: ~1.17.0-beta
  • react-native version: 0.41.2
  • iOS/Android/Windows version: iphone 6 simulator 10.1
  • Does this reproduce on a debug build or release build? Both debug and release.
  • Does this reproduce on a simulator, or only on a physical device? I believe on both, but only 100% confirmed on simulator.
bug fix-in-master

Most helpful comment

Hi @sergey-akhalkov

That totally solves the problem, thanks so much!

All 3 comments

Hi @Phredward, thank you for reaching us, I've just created PR fixing the issue, so would you have a chance to look at it and verify if it works as expected?

Hi @sergey-akhalkov

That totally solves the problem, thanks so much!

Closing this due to #765 has been merged.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ninjz picture ninjz  路  4Comments

panarasi picture panarasi  路  4Comments

ACCTFORGH picture ACCTFORGH  路  3Comments

vira-khdr picture vira-khdr  路  3Comments

DeDuckProject picture DeDuckProject  路  3Comments