7 Commits
Author SHA1 Message Date
Josh Kelley 224023886d Switch to native Promise.allSettled
As discussed in code review, this is widely available.  Update tsconfig.json to recognize it.
2024-11-20 11:43:44 -05:00
Josh Kelley 5f5be096be Fix test failures 2024-11-19 14:53:34 -05:00
Josh Kelley 4ac432c0f8 Fix test failures 2024-11-19 14:53:34 -05:00
Josh Kelley 3ff5225411 Fix potential unhandled rejections in StrategyHandler.doneWaiting
doneWaiting throws on the first rejected promise that it encounters.  This means that subsequent rejected promises may result in unhandled rejection errors.

Fixes #3171
2024-11-19 14:53:33 -05:00
Josh Kelley 904b79212e Fix typos 2024-11-19 14:53:33 -05:00
Josh KelleyandGitHub 0c3bea8e16 Fix NetworkFirst waitUntil (#2744)
* Fix NetworkFirst waitUntil

NetworkFirst's design uses two promises (one for the network request, and one for the timeout). If the network request succeeds, then the timeout promise's timer is canceled. However, it attempted to wait until both promises were done before marking the event as done; this meant that, if the network request succeeded, then it never resolved its handlerDone / awaitComplete promise.

This fixes #2721.

* Add a test to cover the timeout-not-exceeded case

* Explicitly verify that the promise resolved before timeout

* Properly handle network fallback

Improve typings for waitUntil; since the revised logic uses a callback, it can't rely on type inference as much.

* Code review feedback

Follow coding style; remove eventDoneWaiting calls, since that duplicates donePromise.
2021-02-16 22:55:30 -08:00
Josh KelleyandGitHub 85955a424d Add docs on running the test suite (#2756) 2021-02-16 10:55:51 -05:00