adm-zip icon indicating copy to clipboard operation
adm-zip copied to clipboard

`extractAllToAsync` callback need to wait for the writing to finish

Open zce opened this issue 4 years ago • 5 comments

v0.5.6

zip.extractAllToAsync(output, true, err => {
  /* istanbul ignore if */
  if (err != null) throw err
  resolve()
})

ref: https://github.com/cthackers/adm-zip/blob/3caa15d50b54d19a2212a11b5a6c86d89caa4a77/adm-zip.js#L668

zce avatar Sep 22 '21 13:09 zce

Agreed. The callback should wait all extracting tasks finished. And then it could be converted to the modern promise friendly, using promisify.

KevinAo22 avatar Sep 27 '21 07:09 KevinAo22

#393 I submit a PR to fix it. Hope it works.

KevinAo22 avatar Oct 01 '21 06:10 KevinAo22

Yes It seems to work, nice work.

I merged PR, but I dont have access to npm.

5saviahv avatar Oct 02 '21 22:10 5saviahv

I'm pretty sure this changing is causing the callback to never trigger now. An operation that was working now hangs indefinitely.

dscalzi avatar Oct 15 '21 00:10 dscalzi

https://github.com/cthackers/adm-zip/issues/407#issuecomment-990086783) - a workaround

kirrs avatar Dec 09 '21 18:12 kirrs