Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.41k stars 1.99k forks source link

Site migration: site is publicly available but shown in "Coming soon" status on Calypso blue #93571

Open andres-blanco opened 2 months ago

andres-blanco commented 2 months ago

This post: paYKcK-5d7-p2 shows that a site was publicly available but it was shown as "Coming soon" on Calypso.

We should figure out if this can be reproduced and fixed.

jartes commented 2 months ago

Probably related to #91796

lsl commented 2 months ago

What's described in p2 (calypso blue (wpcom rest api) = coming soon, site = public) sounds like the coming soon site option wasn't synced to the atomic site. Could someone on @Automattic/serenity link me to the code where migrations configure site options / atomic transfers? Ideally the coming soon site option if you can.

daledupreez commented 2 months ago

@lsl, we manually launch the site via this block of code after migrations complete: fbhepr%2Skers%2Sjcpbz%2Snflap%2Qwbof%2Svapyhqrf%2Szvtengvba%2Szvtengvba%2Qpyrna%2Qhc.cuc%3Se%3Qp91226sq%23178%2Q200-og

Note that function is called against the WordPress.com data, and not the Atomic site, as the data for the Atomic site should have been completely overridden by the data from the source site.

miksansegundo commented 2 months ago

Just noting that we fixed a somehow-related issue with https://github.com/Automattic/jetpack/pull/39010

miksansegundo commented 2 months ago

the code where migrations configure site options / atomic transfers?

The site options that are migrated from simple to atomic are in a whitelist that contains wpcom_coming_soon and wpcom_public_coming_soon. See fbhepr%2Skers%2Sjcpbz%2Sjc%2Qpbagrag%2Syvo%2Sngbzvp%2Qi2.cuc%3Se%3Q2q829p17%231150-og

daledupreez commented 2 months ago

@miksansegundo and @lsl, I think we need to be specific about terminology:

It may be that we should also be initialising the wpcom_coming_soon option on incoming migrated sites, as the option wouldn't exist on any other hosting platforms, and we may be defaulting in the wrong value when the option isn't present.

lsl commented 2 months ago

wpcom_coming_soon is the old value, shouldn't need setting anywhere, it is only set by the UI to repair old values irrc.

wpcom_public_coming_soon is the new value, it not being initialized shouldn't cause any problems, coming soon should be defaulting off when not set. Is the calypso front end defaulting incorrectly in /sites?


fbhepr%2Skers%2Sjcpbz%2Sjc%2Qpbagrag%2Syvo%2Synhapu%2Qfvgr.cuc%3Se%3Q95o5o18q%26sv%3Qvf_ynhapurq%2353%2Q59-og

I doubt it's relevant but this stuck out, what happens when a site isn't launched or unlaunched?

daledupreez commented 2 months ago

@lsl, I think the issue also revolves around the state of the Atomic site, which is where the logic for (not) showing the Coming Soon pages exists, mostly in https://github.com/Automattic/jetpack/blob/5281706f1082683bc3cf22149e14011a13034d6a/projects/plugins/wpcomsh/private-site/private-site.php. The decision to (not) show Coming Soon is completely handled on the site itself for Atomic sites.

It's most likely that we need to initialise some sort of option on the Atomic site in addition to telling the WordPress.com multi-site that the site has been launched.

lsl commented 2 months ago

This is where the "Coming Soon" label is coming from on /sites:

https://github.com/Automattic/wp-calypso/blob/53ae967f1fb76241cff62979066fbf8a9157e866/packages/sites/src/site-status.tsx#L33

The coming soon value is coming from here for simple sites:

fbhepr%2Skers%2Sjcpbz%2Schoyvp.ncv%2Serfg%2Sfny%2Spynff.wfba%2Qncv%2Qfvgr%2Qjcpbz.cuc%3Se%3Q6r7prss1%26zb%3Q1385%26sv%3Q48%2349-og

and here for atomic:

fbhepr%2Skers%2Sjcpbz%2Schoyvp.ncv%2Serfg%2Sfny%2Spynff.wfba%2Qncv%2Qfvgr%2Qwrgcnpx%2Qfunqbj.cuc%3Se%3Qnno5994q%23213-og

It's most likely that we need to initialise some sort of option on the Atomic site in addition to telling the WordPress.com multi-site that the site has been launched.

It looks more like one of the coming_soon options is being initialized on migration sites when we don't want it to be. We may need to change that or clear it in the migration cleanup.

lsl commented 2 months ago

Just noting that we fixed a somehow-related issue with https://github.com/Automattic/jetpack/pull/39010

Confirming this isn't related to the other issue https://github.com/Automattic/wp-calypso/issues/91796, I don't think it could be related to this issue either.

Tested editor loads with: wpcom_comming_soon: '0', wpcom_public_coming_soon: 1, blog_public: -1, launch-status: launched