microsoft / appcenter-cli

Command-line Interface (CLI) for Visual Studio App Center
https://appcenter.ms/
MIT License
581 stars 234 forks source link

First CodePush update is always a full download #388

Closed saifeer closed 6 years ago

saifeer commented 6 years ago

Hey,

I have been doing various tests with CodePush and I find that the first time we create a new CodePush release, the device always downloads the full www directory. From there onwards, the downloads are always delta of the updates from the second release onwards.

Is there any way to have CodePush only download the delta updates for the first CodePush release?

Thanks!

Zakeelm commented 6 years ago

Hey there!

As of now, this is currently not possible. But, I have spoke with some of our engineers and we're going to investigate the possibility of this going forward. I can follow up with you regarding this if there are any updates!

saifeer commented 6 years ago

Thanks @Zakeelm.

This is especially important for businesses like us who have large apps and we cannot have every user download the entire app contents the first time for each new version of the App Store.

Thanks for following up on this!

svekl commented 6 years ago

Hi @saifeer, the issue here is that CodePush release is completely independent from app release in market, so, for diff to work it has to download full package first to apply diff updates to it in future.

But I understand your pain here, extra 300Mb to download is a real issue, so I'm working on a workaround for you assuming that in your case every app release to market always has a corresponding release in CodePush.

saifeer commented 6 years ago

Hi @svekl, Yes this is what I was thinking as well. I had 2 solutions in mind. I guess I prefer the first one but I am fine with both:

  1. Whenever we release the app to the market, we push an "initial" code push update to the app center that is exactly the one we pushed to market. There is a flag in the api which allows that update to be marked as "initial or pseudo". This update is not pushed at all by CodePush to any devices but is only maintained for the sole purpose of being able to do a diff against a later "real" codepush update. There would have to be some rules around this though:

    • The initial code push should be optional. In case it is not present, app center continues to work like today downloading the full www upon first push - so it wont break anything for existing users and others who do not care about the first push (for eg. really small apps)
    • The initial code push can only be pushed as the first push for any version. Once you have pushed some other release already, you cannot do an initial push on top for it. This way there is no confusion around in-between updates not being pushed.
  2. This is what you suggested above I think. For every release of the app to the market, we upload the corresponding IPA file (in case of Apple) to the releases tab in App Center. When a new update is pushed to CodePush and if this is the first one, it will do a diff against the files uploaded in the IPA. Once again there would be some rules around this:

    • This should be optional so if a release is missing, then CodePush just works like today. This will ensure it wont break anything for existing users and also ensure testing is easy
    • Only the first CodePush update for every version will be checked against the release. All others will work like today.

Thanks for spending time on this! Let me know what you think.

Zakeelm commented 6 years ago

Hey, thanks so much for the feedback @saifeer. That's a good idea. We're going to further investigate both methods and follow up. I don't have an ETA on this as our backlog is pretty full, but this is something we would definitely like to make better going forward.

saifeer commented 6 years ago

Thanks @Zakeelm. I understand that this isn't just a small change to be done quickly and would also probably require extensive testing. Please try to update this issue with an ETA as soon as this issue comes up in your list. Appreciate your time and efforts on this one. Do let me know if I can help.

amchew commented 6 years ago

Hey @saifeer , thanks for reaching out! We've logged this down in our backlog now and as Zakeel mentioned, we don't have an ETA for this now, and I'll be proceeding to close this ticket. If you have any questions, feel free to ping us and we'll reopen this ticket.

Yes, we super welcome community contributions/fixes, you can help by contributing to our open repo. Here's the documentation on how to do so.

Thank you, and have a good weekend! Amanda

IllusionVK commented 4 years ago

@amchew Hey Amanda, just wondering if there was any feedback if this item had made it on to a roadmap/development pipeline ? We also have this same problem = user downloads app from app store 100mb, then on first open, they have to re-download 80+mb again of the same files. This causes real problems for our users who work in disaster zones and are working over satellite connections that are both slow and very expensive per mb.

Previously we utilised https://github.com/nordnet/cordova-hot-code-push and it didn't have this problem which was solved by a manifest being generated during a build. This then allowed the app to send this to the server, so that the server could check its manifest/hashes for each file against the manifest sent up from the app.

Thanks for your help !