[w3c/ServiceWorker] Batch Cache Operations can't return an empty list (Issue #1677)

For batch cache operations, a request/response is appended to the list for every operation, so the list always has a size of number of operations.

- Let resultList be an empty [list](https://infra.spec.whatwg.org/#list).
- [For each](https://infra.spec.whatwg.org/#list-iterate) operation in operations:
- - [Append](https://infra.spec.whatwg.org/#list-append) operation’s [request](https://www.w3.org/TR/service-workers/#dfn-cache-batch-operation-request)/operation’s [response](https://www.w3.org/TR/service-workers/#dfn-cache-batch-operation-response) to resultList.
- Return resultList.

Then the cache.delete steps are
- Let requestResponses be the result of running [Batch Cache Operations](https://www.w3.org/TR/service-workers/#batch-cache-operations) with operations. If this [throws](https://webidl.spec.whatwg.org/#dfn-throw) an exception, set errorData to the exception.
- If requestResponses [is not empty](https://infra.spec.whatwg.org/#list-is-empty), resolve cacheJobPromise with true.

But this also means that when no entries are matched, it also returns a length of 1, meaning it always should be returning true?

I'm sorry if I'm misunderstanding anything but I'm stuck here.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1677
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/issues/1677@github.com>

Received on Monday, 17 April 2023 19:45:07 UTC