Spomky-Labs / pwa-bundle

PHP library for generating a full featured PWA manifest
https://pwa.spomky-labs.com
MIT License
28 stars 1 forks source link

Refactor prefetch method to use async/await #193

Closed Spomky closed 2 weeks ago

Spomky commented 2 weeks ago

This commit refactors the prefetch method in prefetch-on-demand_controller to use async/await for better error handling. The response from the workbox.messageSW method call is now awaited, and an event is dispatched based on the result, informing whether prefetching was successful or not.

Target branch: 1.2.x Resolves issue #192

Spomky commented 2 weeks ago

Please be aware that Workbox will consistently return 'true', regardless of whether any of the URLs failed. Essentially, the task is marked as completed, though there's no assurance it's stored in the cache.