Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor prefetch method to use async/await #193

Merged
merged 1 commit into from
May 5, 2024
Merged

Conversation

Spomky
Copy link
Member

@Spomky Spomky commented May 5, 2024

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

  • It is a Bug fix
  • It is a New feature
  • Breaks BC
  • Includes Deprecations

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.
@Spomky Spomky added the enhancement New feature or request label May 5, 2024
@Spomky Spomky added this to the 1.2.0 milestone May 5, 2024
@Spomky Spomky self-assigned this May 5, 2024
@Spomky Spomky linked an issue May 5, 2024 that may be closed by this pull request
@Spomky
Copy link
Member Author

Spomky commented May 5, 2024

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.

@Spomky Spomky merged commit 3183d22 into 1.2.x May 5, 2024
10 checks passed
@Spomky Spomky deleted the features/prefetch-event branch May 5, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefetch Url does not send event
1 participant