You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An AbortSignal already aborted when ZipWriter#add() or Entry#getData() is called now rejects the call. The signal was only handed to pipeTo(), 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 with signal.reason when it is set, so the error is unchanged on the engines that already honored it, or with an AbortError whose message is ERR_ABORTED otherwise, signal.reason not existing before Chrome 98. A pre-aborted add() also rejects before the temporary stream of a buffered entry is created, so nothing is allocated to dispose
The chunks of a ZipReaderStream now expose the properties deposited on an entry while its data is read, i.e. EntryMetaData#warnings and EntryMetaData#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 from ZipReaderStream although the types promise it. The chunk now shares them with the entry, so they are readable on it once its readable property has been consumed
BlobReader no longer fails with sourceBlob.stream is not a function when its source is a Blob-like object exposing only size, slice and arrayBuffer. It reads with stream() when the source has it and falls back to the slice()/arrayBuffer() path otherwise, which the reader already implemented for the engines whose Blob#slice is unreliable
Documentation
The signal option 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() and getData() are called, with and without a reason, registered without the pipeToSignal feature gate so that it runs on the engines the fix is for
New test covering a BlobReader over a source without stream()
The warnings test asserts that a ZipReaderStream chunk 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 Reader instead; a second case pins that a pre-aborted add() creates none