-
Notifications
You must be signed in to change notification settings - Fork 512
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
Corruption when zipping fast #504
Comments
Did you implement anything to ensure that websocket messages are ordered or does your environment guarantee it? See https://stackoverflow.com/questions/11804721/can-websocket-messages-arrive-out-of-order |
The websocket isn't an issue, it's receiving the same amount of bytes and in the right order (I printed out size of bytes received in my erlang backend and size of bytes written from JavaScript) so the zip I'm making using .add function is what's wonky, it's really a few of the exact same entries that aren't writing correctly (the failed to inflate message for the same files each time) |
Can you reproduce the issue if you replace |
Same thing happens const {readable, writable} = new TransformStream({flush: () => { writer.close() }})
const reader = readable.getReader()
const yes = async () => {
while (true) {
const { done, value } = await reader.read();
if (done) {
break;
}
// send chunk
}
yes()
writer.readable.pipeTo(writable, { preventClose: true }) Output without delay:
|
My bad found the issue, i'm embarrassed sorry for wasting your time |
No problem, I'm glad to hear that the issue is fixed :) |
Probably something on my end, but for some reason Zip files are more corrupt when having no delay between adding files. So, there are two issues but hoping to have them both fixed on my side
The Output
Output without delay:
Output with delay:
The Code
Pretty much, I have an emscripten WASM directory that I'm zipping up using zip.js. To be speedy I am uploading the chunks to a websocket as it's being zipped up:
The text was updated successfully, but these errors were encountered: