Skip to content
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

abort behavior of making zip in the latest FF (greater than v100) #298

Open
wangf1978 opened this issue Dec 6, 2022 · 0 comments
Open

Comments

@wangf1978
Copy link

From Firefox v100, WritableStream is already supported, don't need third-party ponyfill anymore.
However, the StreamSaver implementation has different behavior to abort making zip in FF comparing with Chrome/Edge, here is the detailed information:
In zip-stream.js

  export default function createWriter (underlyingSource) {
  .....
    return new ReadableStream({
      start: c => {
        ctrl = c
        underlyingSource.start && Promise.resolve(underlyingSource.start(zipWriter))
      },
      pull () {
        return processNextChunk() || (
          underlyingSource.pull &&
          Promise.resolve(underlyingSource.pull(zipWriter))
        )
      }
    })
  }

If underlyingSource.pull receive an exception, and generate a promise reject, in Chrome/Edge, the download will stop, and no zip stream is written to local downloader folder, it is perfect!

But in the FF, the zip file is still created, and saved to the local download folder although in FF download manager it showed "fail"
image
image

Any hint to solve this issue?
I tried fileStream.abort, writer.abort, all of them can't solve this issue in FF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant