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

[Browser] Return a loading page from the service worker if the web worker isn't ready yet #10

Closed
adamziel opened this issue Sep 22, 2022 · 1 comment

Comments

@adamziel
Copy link
Collaborator

adamziel commented Sep 22, 2022

What problem is this issue looking to solve?

The service worker passes requests to .php files to the web worker. However, the web worker may not be loaded yet or it could be busy at the moment.

How does this issue proposes to solve it?

Reply with HTTP 502 or HTTP 408 eventually somewhere here:

https://github.com/adamziel/wordpress-wasm/blob/9d04a113a97f53a1303fefba642f65f1b5a5a5f6/src/web/service-worker.js#L31-L52

@adamziel
Copy link
Collaborator Author

This shouldn't be an issue anymore as the initialization pipeline should prevent this situation from arising in the first place.
Returning a loading page is tricky anyway as it not always clear what kind of response is expected. If this will cause any problems in the future, let's first look into intercepting requests in the service worker only after the WASM WordPress is up and running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant