Commit 0cd87a9
fix(sw): return inner promise in activate cache cleanup (webpack#7928)
The cache.keys().then() chain inside the activate event handler
was not being returned, so event.waitUntil() resolved immediately
with undefined before any stale cache entries were deleted.
This meant old cache entries from previous deployments would
accumulate in users' browsers silently with no guarantee of cleanup.
Fix by returning the inner promise chain and using Promise.all()
to delete stale entries in parallel, ensuring event.waitUntil()
only resolves once all deletions are complete.1 parent c4e38af commit 0cd87a9
1 file changed
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
0 commit comments