Closed az0uz closed 11 months ago
Right now, when there is a network issue in a chunk request, the get will still complete and return data, with that errored chunk data containing zeros, this change will fix that, and correctly throw on that method if any of the chunk requests errored. This will also throw the underlying AbortError when passing an AbortSignal to the Store through StoreOptions.
I can confirm this is fixing a bug we have in our attempt to write a proxy Store to cache chunk requests.
fixes #140
Errors being thrown by
chunkGetItem
(and underlying storage requests) are uncaught.The use of the PQueue class will both emit an
error
event and throw if awaiting the Promise returned by thequeue.add
method.To prevent this issue, I created an array of
queue.add
promises, and await for all those promises instead of usingqueue.onIdle()
.Using the error event will still be considered as uncaught errors since nothing is awaiting the queue.add promises.