microsoft / react-native-code-push

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

Diff-update to a binary release #1341

Closed zen0wu closed 6 years ago

zen0wu commented 6 years ago

Based on my observation, it seems that CodePush is able to download a diff-update between two codepush releases, which makes sense, but not so much for a binary release.

This means that if I install the app from App Store, and it tries to update itself with CodePush, it would download the whole bundle and then Applying Full Update would show up, while if I'm already on a CodePush, it would show up as Applying Diff Update in the log. Since our bundle is pretty large, is there any way we can make diff-update happen for binary release? Or maybe I missed something when doing the integration?

Expected Behavior

Binary release applied with Full Update.

Actual Behavior

It should apply Diff Update when possible.

Environment

alexandergoncharov-zz commented 6 years ago

Hi @shivawu , Thanks for reporting!

Unfortunately It isn't possible to make diff with binary version for now as all diff logic working on server and there is calculating differences between updates. But I think that it can be investigated as enhancement. Let me investigate it more closer.

Thanks, Alexander

zen0wu commented 6 years ago

@alexandergoncharov Thanks for investigating! That's my guess too based on looking at the code.

Conceptually, it should be possible. Maybe code-push-cli would need to add a command for uploading built binary release/its bundle and assets to codepush, with its version. Then when the client asks for a download, it needs to send its client version and the server would be able to find the right bundle to diff.

I totally made things up above, looking forward to your investigation! :)

alexandergoncharov-zz commented 6 years ago

Hi @shivawu ,

Seems it isn't possible to implement for now as it isn't possible to install diff-update to binary version. And this is why the first update will be always full. After first full update it is possible to install diff-update on already installed update. I'm sorry to saying this. So, I'm going to close this issue for now but please feel free to reopen it if you have any questions.

Thanks, Alexander

zen0wu commented 6 years ago

Thanks for the investigation @alexandergoncharov! Just wondering why it isn't an option to adding an extra command to upload the binary bundle to codepush so that it could be diffed against?

alexandergoncharov-zz commented 6 years ago

Yeah, it is possible to implement extra option and we can get diff with binary version but it will not fix this issue as we can't install this diff update on binary version, only full update. It isn't possible to mix updates and binary files fo now. That is reason that we install only full update for first installing.

Please let me know if you have any questions.

mavericksunny commented 5 years ago

@alexandergoncharov Are you guys still working on this issue? I was having the same requirement, wanted to understand why we cant mix binary and code push bundles

witalobenicio commented 5 years ago

@alexandergoncharov We need to do some thing to update only diff when we already on codePush bundle? Or it already works this way?

hardik-flyfin commented 1 year ago

any updates