What's Changed in v2.11.4
Bug fixes
- An
AbortSignalalready aborted whenZipWriter#add()orEntry#getData()is called now rejects the call. The signal was only handed topipeTo(), which ignores it on the engines below its support floor, i.e. the oldest browsers the test matrix covers: the whole entry was then written and there was nothing left to abort. Both methods now check the signal before starting, and reject withsignal.reasonwhen it is set, so the error is unchanged on the engines that already honored it, or with anAbortErrorwhose message isERR_ABORTEDotherwise,signal.reasonnot existing before Chrome 98. A pre-abortedadd()also rejects before the temporary stream of a buffered entry is created, so nothing is allocated to dispose - The chunks of a
ZipReaderStreamnow expose the properties deposited on an entry while its data is read, i.e.EntryMetaData#warningsandEntryMetaData#localDirectory. The chunk was built from a copy of the entry taken before the read started, so those two were permanently absent from it, and the warnings channel added in v2.8.x was unreachable fromZipReaderStreamalthough the types promise it. The chunk now shares them with the entry, so they are readable on it once itsreadableproperty has been consumed BlobReaderno longer fails withsourceBlob.stream is not a functionwhen its source is aBlob-like object exposing onlysize,sliceandarrayBuffer. It reads withstream()when the source has it and falls back to theslice()/arrayBuffer()path otherwise, which the reader already implemented for the engines whoseBlob#sliceis unreliable
Documentation
- The
signaloption of the reader and of the writer documents that a signal already aborted rejects the call, and with which error
Tests and continuous integration
- New test covering a signal already aborted when
add()andgetData()are called, with and without a reason, registered without thepipeToSignalfeature gate so that it runs on the engines the fix is for - New test covering a
BlobReaderover a source withoutstream() - The warnings test asserts that a
ZipReaderStreamchunk carries the local directory and the warnings of its entry - The temporary stream test no longer uses a pre-aborted signal to reach its error path, which no longer creates a temporary stream, and covers a failing
Readerinstead; a second case pins that a pre-abortedadd()creates none