-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZIP file corrupt via safari/iOS, but on Chrome working #433
Comments
Thank you for the detailed info and the kind words, could you tell me if setting the option |
Thanks for the fast response @gildas-lormeau. Sorry feeling a bit dumb to not understand it how to do :< |
No problem ;). Please try to execute this code after the import of zip.js and before using it in your code: |
With the Maybe also a good hint in the Readme specially for Safari/iOS/Cordova, because this issue does not always exist, but just in some cases like I wrote above. Thank you for this very fast support & feedback & help! |
If you want to see this bug fixed, it would be better to report it to Apple because they are the author of this bug. If you can, please report it here: https://bugs.webkit.org/. |
FYI @AshleyScirra |
Got it! Thanks ! Even so the question: Do you know if there are other issues when I don't use the 'UseCompressionStream' for iOS or restrictions for some apis/solutions inside this library? Else this ticket would be closed for me so! |
The only issue is that the compression is probably a bit slower when the option is set to false. |
Hello there,
first of all I wanted to say, this library is realy great and is working fast and great!
Before we start maybe my short use case:
I'm developing a open source coffee app which stores all data locally.
Android and iOS has issues, when the .JSON-File will get bigger then 5MB.
Thats why I implemented with this library a logic to split my IndexDB entries into several .JSON-Files to not reach the 5MB limit on each.
Generating a ZIP-File with one main .JSON works flawless on iOS and on Android.
Strange it gets when I create several chunk-sized.json
The idea is to split the users coffee brews to chunk sizes for 500 brews each file and having one main file (Beanconqueror.json) and when importing the zip to put them all together again - which works pretty good!
When I use my sample .JSON-File with a size of 1.9 MB, I'll get a zip file with 3 entries:
Beanconqueror.json
Beanconqueror_Brews_1.json
Beanconqueror_Brews_2.json
On iOS the same logic produces also a ZIP file, but on Android its 5 KB smaller then on iOS.
But when I open now the zip file on MacOs I'm getting following issue:
-> Funny enough I can open this file on Android!
One test was now to create bigger chunk-sized files so I set 1000 entries each file, and I just got 2 files:
Beanconqueror.json
Beanconqueror_Brews_1.json
-> Then iOS ZIP file was generated, and can be opend on IOS then.
I've digged a bit deeper and tried different parameters, and found out when I remove the compression on iOS:
Everything works fine!
Also to mention:
When I do this on Chrome on a Mac, the ZIP file works (with the 3 entries)
When I do this on Safari on the same Mac, the ZIP file is corrupt (with the 3 entries)
The code logic you can find here:
https://github.com/graphefruit/Beanconqueror/blob/c4eec36d537f7912328e23074b631ee56e576d99/src/services/uiExportImportHelper.ts#L48
Hope you can help me! Would be awesome if I can enable compression again.
"@zip.js/zip.js": "^2.7.14",
"typescript": "^4.9.4",
Thank you so far & Keep up the great work
Lars
The text was updated successfully, but these errors were encountered: