nb: I’m not seeing this behaviour on all shortcut folders. I need to check why some are and some are not.
I think the randomness I’m seeing is because the folder verification and page fetches are both being done asynchronously at the same time. I think the use of “Utils::all” at the end of API_Client::execute is intended to cause an error to be returned if either fails, but I don’t think that will always be reached. If the page fetch returns first, then I think its use of wp_send_json, in the response processing, will effectively stop the processing (by calling “wp_die” or “die”) before that check is reached.
It seems a bit strange to queue the page fetch before you have confirmed the path is valid. And as noted at the start, I’m not sure the path checking works for a google shortcut anyway.
If you replace “wp_send_json( $page )” by “return new FulfilledPromise( $page )” you can defer calling “wp_send_json” until after the “all” aspect of the promise has been evaluated. Then just apply wp_send_json to the first non-null response from “API_Client::execute”.
Doing this for Frontend Page and Gallery classes seems to remove the randomness of the folder verify checks. Unfortunately, that means all shortcut folders then fail the verification.
Hi,
thanks, I’ve seen the issues on GitHub and will look into it, there is some issue with shortcuts in general. It seems that the problem happens when the shortcut name is different from the original folder name, so maybe in the meantime that could help.
Thanks,
Marek
Should be fixed as of 2.13.11.
Thanks!