I have been trying to test the incremental updates via CodePush for our app and it seems to not work for me. From what I understand, CodePush only downloads the files that have actually changed between 2 updates. However, whenever I test this, I see the entire www directory being downloaded everytime.
I have an app that is quite big - around 300MB. I tried to first run the app, then change 1 file and push an update to codePush as v1 and then change the same file again and push another update to codePush as v2.
I found that the app detected the updates correctly on both occasions. However, on both updates, the update.zip file that got downloaded contained the entire www directory contents.
On both occasions, I used the command "appcenter codepush release-cordova -d Production" to generate the releases and on both occasions the console showed that the file change was picked up correctly:
Merging and updating files from [www, platforms/ios/platform_www] to platforms/ios/www
copy www/index.html platforms/ios/www/index.html (updated file)
Can someone explain how can I get the incremental updates to work?
Hi @saifeer, thanks for reaching us.
Could you please confirm if you have the following repro steps?
index.html file contents and release an update v1index.html file contents one again and release another CodePush update v2As for me, I've got the following v2 update info:
{
"target_binary_range": "1.5.0-beta",
"blob_url": "https://codepush.blob.core.windows.net/storagev2/U5YoXuHhpQgvVVQGNc2J5Dx2sab40840428d-683e-4d30-a120-c592a355a594",
"is_disabled": false,
"is_mandatory": false,
"label": "v2",
"package_hash": "a46df4f33b2cd31ae27a8614c382860064c869326a1f39b418e058f7635d47b1",
"released_by": "[email protected]",
"release_method": "Upload",
"rollout": 100,
"size": 113772,
"upload_time": 1516107085343,
"diff_package_map": {
"58c8b7fe6f132cdb56cdff59b121b01f62c0c06b4100c4a23e94e702d84b51ad": {
"size": 1532,
"url": "https://codepush.blob.core.windows.net/storagev2/8wuI2wwTlf4RioIb1cLRtyQyzRW80840428d-683e-4d30-a120-c592a355a594"
}
}
}
As you can see it contains diff_package_map and if you download its contents you'll find that update package contains index.html file only - the file I've changed for update v2.
So could you please provide us more info regarding your issue (repro steps / minimum working demo where the issue reproduces). Please also make sure if you do not reinstall your app between CodePush updates.
Hi @sergey-akhalkov,
Thanks for the response. When I tried this with the sample app, it downloads the entire www content for v1 and then only downloads the incremental for v2.
However, when I tried the same with my app repository, it still does not work.
Package 1 details are:
{"appVersion":"1.2.1","deploymentKey":"XXXX","downloadUrl":"YYYY","isMandatory":false,"label":"v1","packageHash":"ba0cb5c6c6bcea8cefc1f5a4495a5548d36b940cb93063bcc47ffb7fa17ae9b2","packageSize":282358860,"failedInstall":false}
Package 2 details are:
{"appVersion":"1.2.1","deploymentKey":"XXXX","downloadUrl":"ZZZZ","isMandatory":false,"label":"v2","packageHash":"8f80ff3f01e6c49fd8094fc722fa2c2e6601de7e89a71a0a0c7c26b6703c0ee0","packageSize":282358861,"failedInstall":false}
As you can see, the packageSize is almost the same although I have only changed 1 file.
Is there any limitations to the app size for correctly generating the update delta? We have a lot of files in the www folder and as you can see, the app itself is quite big - almost 300MB.
Also, I never got the diff_package_map in the JSON response in any of the tests (even the one that worked correctly with the sample repo). Is there a different method to generate the packages that you are using?
Also note that due to issue https://github.com/Microsoft/cordova-plugin-code-push/issues/351 I had to manually rename the hooks folder to be called scripts as suggested for the sample to work correctly.
Is there are different version of the plugin that you are using?
Hi @saifeer,
Also note that due to issue Microsoft/cordova-plugin-code-push#351 I had to manually rename the hooks folder to be called scripts as suggested for the sample to work correctly.
Is there are different version of the plugin that you are using?
This issue has been fixed in new version of Cordova Plugin for CodePush - v1.11.2, please update and let us know if you still see any issues.
Is there any limitations to the app size for correctly generating the update delta?
As I know we have no file size limits for diffing, but we have maximum limit in 500MB
Also, I never got the diff_package_map in the JSON response in any of the tests (even the one that worked correctly with the sample repo).
To get full response from the server while executing App Center CLI commands - please use --debug parameter.
Is there a different method to generate the packages that you are using?
It's really weird that diffing does not work you and we are going to see what the root cause of the issue is. Could you please share what command you are using to release CodePush updates?
Hi @sergey-akhalkov,
I will try again with v1.11.2 and --debug.
I always use the following command to generate CodePush updates:
appcenter codepush release-cordova -d Production
Also, is it expected that the v1 of CodePush update will always contain the full www directory. It makes sense that it would since it has nothing to diff against but just want to make sure that I understand that correctly.
Hey @sergey-akhalkov,
I tried with v1.11.2 and I dont have the issue of the missing after install js but I still have the original problem of not getting incremental builds. I tried a variation of the command that forces build instead of prepare but no luck :(
appcenter codepush release-cordova --d Production --debug --build
Hi @sergey-akhalkov,
After doing countless tests with various combinations, I finally found the problem! I had a file in my repo which was named "Australia_鈥揰Land_of_Tomorrow_poster.jpg". Notice that the hyphen '-' is not the regular dash character but an em dash or en dash. It was due to this filename that the diff process must be crashing and I always got the full package. Once I changed the filename, it all started working fine.
So now, I have 3 questions:
Thanks for your help!
Hi @saifeer, it's really good to know what the root cause of the issue was, thank you for your investigation and sharing the results!
As for your questions - we are going to investigate them in order of priority and let you know the results. And as for the last questions - we are going to see what kind of improvements we can implement for App Center CLI to add client-side validation or so for update contents to avoid of such kind of issues you've faced with.
Please let me know if you have any questions or considerations.
@saifeer Hello again, could you please share with us your deployment history via appcenter codepush deployment history <progectName> <deploymentName> --format json so we can reproduce your issue and debug our code.
Hi @annakocheshkova,
I erased all my deployment history since it was all just testing. But you should not need my deployment history to reproduce this issue. Here is how you can reproduce this issue:
Now clear your deployment history and repeat the exact same steps above but remove the image file you added above OR just rename it to some other name that does not have the special dash. So for eg you could now call it "Australia.jpg". You will find that this time, v2 will only contain the incremental changes instead of the entire www folder.
Let me know if you need more details.
Thanks for checking!
Hey @sergey-akhalkov!
I just realised that in one of the earlier comments, you mentioned:
As I know we have no file size limits for diffing, but we have maximum limit in 500MB
What exactly is this limitation and what impact does it have?
The reason why I am asking is because we are planning to add more content into our app that might take our app from its current size to ~600MB. Is this going to be an issue?
Thanks!
@saifeer We're going to look into raising that max limit for individuals who request it. I've started this conversation with our engineering team and we're going to see if this is something we can manage to do, if possible.
Thanks @Zakeelm. I also saw your notes on Microsoft/cordova-plugin-code-push#379 and Microsoft/cordova-plugin-code-push#334 so hopefully we have the new upload service soon and then this restriction is removed. I will just follow those 2 issues then and we can ignore this digression.
In that case, can we go back to the original problem of incremental updates not working for special filenames? See my comment for reproducing that issue here
We're going to have to re-investigate this as we've had some internal changes to the Engineering team. I'm going to send this to one of the engineers to take a look at. Will be in touch!
Hi @Zakeelm are there any updates on the investigation please?
Hi, we have a fix for this issue. Waiting on deployment sometime in the next day or two.
Most helpful comment
Hi @sergey-akhalkov,
After doing countless tests with various combinations, I finally found the problem! I had a file in my repo which was named "Australia_鈥揰Land_of_Tomorrow_poster.jpg". Notice that the hyphen '-' is not the regular dash character but an em dash or en dash. It was due to this filename that the diff process must be crashing and I always got the full package. Once I changed the filename, it all started working fine.
So now, I have 3 questions:
Thanks for your help!