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

wp-admin doesn't work without internet #74

Closed
cpapazoglou opened this issue Jun 8, 2023 · 1 comment
Closed

wp-admin doesn't work without internet #74

cpapazoglou opened this issue Jun 8, 2023 · 1 comment

Comments

@cpapazoglou
Copy link

cpapazoglou commented Jun 8, 2023

While the frontpage of wordpress loads without internet, /wp-admin seems that it needs an internet connection. Without it, loading fails and the server gets killed.

Steps to reproduce

  • In an empty folder run wp-now start so that wordpress gets downloaded
  • Disable internet in your machine ( eg turn wifi off )
  • Go to /wp-admin
  • ERR_CONNECTION_REFUSED, localhost refused to connect.
  • The localhost server gets killed.
Error: getaddrinfo ENOTFOUND api.wordpress.org
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'api.wordpress.org'
}
@danielbachhuber
Copy link
Member

Thanks for the report, @cpapazoglou !

This is a duplicate of WordPress/wordpress-playground#535

I think php-wasm will need to be updated for this scenario. Let's continue the conversation in the first issue.

@danielbachhuber danielbachhuber closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
johnhooks pushed a commit to johnhooks/playground-tools that referenced this issue Oct 11, 2024
The Origin-Agent-Cluster: ?1 is used to request a separate process for the iframe-worker.html in Google Chrome. It worked perfectly when the root app was served from wasm.wordpress.net and the iframe-worker.html was served from wasm-worker.wordpress.net.

Recently both these domains have been merged to allow direct communication between the Service Worker and the iframe Worker Thread. Now I'm observing the following error message:

> The page requested an origin-keyed agent cluster using the Origin-Agent-Cluster header, but could not be origin-keyed since the origin 'https://wasm.wordpress.net' had previously been placed in a site-keyed agent cluster. Update your headers to uniformly request origin-keying for all pages on the origin.

Accordingly to the Origin-Agent-Cluster docs at https://web.dev/origin-agent-cluster/, the clustered resource must be loaded from a different origin. That’s what this commit does.

As a side-effect, the Service Worker can no longer directly communicate with the Worker Thread since they’re registered on separate origins now. The `worker-thread/window.library.ts` bridges that gap by proxying all the relevant BroadcastChannel communication to the Worker Thread.

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

No branches or pull requests

2 participants