Touffy / client-zip

A client-side streaming ZIP generator
MIT License
342 stars 22 forks source link

[BUG] Extracting duplicate files #32

Closed xsurge83 closed 2 years ago

xsurge83 commented 2 years ago

Describe the bug We have a Windows user that is reporting duplicate files after unzipping the folder. Does client-zip tested on Windows OS?

To Reproduce Steps to reproduce the behavior:

  1. Concat multiple File using await downloadZip([file]).blob()
  2. Unzip file on Windows machine.

Unzipping the same files works on Mac OS.

Expected behavior Should unzip with one file or number of files provided to downloadZip

Desktop (please complete the following information):

Touffy commented 2 years ago

I haven't tested it on Windows, no. Can you post the actual Zip file downloaded by your user or reproduce the issue ? it's possible that they included the same file twice in the archive if your system allows it (client-zip currently accepts multiple entries with duplicate filenames, which could be fixed easily if that's the source of your bug).

xsurge83 commented 2 years ago

I can't share the zip file. We download the file on the client side and call downloadZip. Here is the snippet:

downloadZip([new File(respons.body as Blob, filePath)]);
Touffy commented 2 years ago

Out of curiosity, why are you not using the Response itself as input for downloadZip ? or a custom object with the Response as input and a filename ?

Anyway, I really don't see why that code would cause client-zip to duplicate the entry. I would need a reproducible case to debug it. Are you sure the user isn't just opening the zip file twice ?

Touffy commented 2 years ago

Any news ?

Touffy commented 2 years ago

I'm closing this until someone sends me enough data to reproduce the bug.