Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Remove incumbent/fetching record from Cache behavior #1190
This change removes the incumbent/fetching record concept that allowed
This changes the specification type of underlying cache objects from a
This change removes the incumbent/fetching record concept that allowed committing a fetching resource to cache and match/matchAll to return a fully written existing resource, if any, with priority over a fetching resource. After this change, add/addAll/put promises resolve when the resources ared fully fetched and committed to cache. match/matchAll will not return any on-going fetching resources. This changes the specification type of underlying cache objects from a map (request to response map) to a list (request response list). The change is to make the arguments and the return values of the Cache methods and algorithms (Batch Cache Operations and Query Cache) conform to one another. The list type seems fine as the algorithms tend to iterate through the list to find certain items with search options. Looking at the details of the acutal implementations, I plan to update it further if needed. Fixes #884.
jakearchibald left a comment
It isn't a problem caused by this PR, but I think we're using JS objects too much in the cache spec. Ideally we should only create new
We've got a couple of instances in the service worker spec that follow this pattern:
…where someList is an infra list.
Do we need to do this? I thought it would be enough to resolve the promise with someList, and IDL takes care of the FrozenArray creation in the correct realm, but I can't find a direct spec reference for that.
@annevk "resolve" automatically queues a task on the promise's event loop https://www.w3.org/2001/tag/doc/promises-guide#shorthand-manipulating.
- Adjust variable scope - Change to early-exit in fetch abort cases - Fix async steps of fulfillment handlers - Change the interface of Batch Cache Operations algorithm . Change to not return a promise . Remove the in parallel steps and make it work synchronously . Change the call sites to call it in a created promise's in parallel steps