no rollback when not call notifyAppReady
Steps to Reproduce
1.query&download&install an update manually 2.restart app 3.getUpdateMetadata shows current is in the new version
Expected Behavior
according to the docs, it should be rollbacked if I install update manually and don't call notifyAppReady.
Actual Behavior
rollback not happen.
Reproducible Demo
async startUpdate() {
if (!this.state.localPackage) {
//this.setState({ showUpdating: true });
var localPackage = await this.state.availableUpdate.download(({ receivedBytes, totalBytes }) => {
console.log(receivedBytes, totalBytes);
if (this._isUnmount) return;
this.setState({
downloadProgress: receivedBytes / totalBytes,
});
});
if (this._isUnmount) return;
console.log('download ok', localPackage);
this.setState({ localPackage });
}
if (this._isUnmount) return;
var ok = await this.waitAlert();
if (!ok) return;
await this.state.localPackage.install();
console.log('install ok!');
}
Environment
- react-native-code-push version:^5.2.0-beta
- react-native version:^0.51.0
- iOS/Android/Windows version:Android 7.0 API24
- Does this reproduce on a debug build or release build? All
- Does this reproduce on a simulator, or only on a physical device? All
Hi @fatfatson, Thanks fo reporting! Could you please attach archive with sample project to reproduce?
Thanks!
Hi @fatfatson, Is the issue still relevant for you?
Hi @fatfatson, I’ll close this issue for now, please open it again if there are any questions.
yes it still exist, but now I'm using the builtin sync method to workaround it.
Hi @fatfatson,
I've reproduced you issue. The point is that notifyAppReady method is called in componentDidMount method:
https://github.com/Microsoft/react-native-code-push/blob/163e2b5b8d1fd0b6967507444881ebd6ceb7f0f3/CodePush.js#L464
I tried to comment this line and my update rolled back to previous version.
Please, let me know if it was helpful for you.
Hi @fatfatson, I hope my clarification was helpful for you, will close this issue for now. Please open it again if there are any questions.