Automattic / wp-calypso

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

Templates Blanked or Deleted when Making Changes to Global Styles with Gutenberg Active #92191

Closed masperber closed 1 month ago

masperber commented 3 months ago

Quick summary

Under certain circumstances, a template can be blanked out when making changes to Global Styles, if Gutenberg is active. This "blanking out" appears a revision entry, and it can be reversed by visiting the template's revision history, but from the user's perspective, it is difficult to understand what has happened or how to reverse it.

Steps to reproduce

This is one set of steps to reproduce this issue. There may be other circumstances that can produce the bug.

  1. Create a plugin-enabled site on WordPress.com
  2. Activate the theme Zaino
  3. Ensure that WooCommerce and Gutenberg plugins are active
  4. Go to Appearance > Editor, then Templates, then edit the template Page: Cart
  5. Open Global Styles
  6. Click on Blocks, then search for the Mini-Cart Proceed to Checkout Button
  7. Change the button text to another color
  8. Note that the "Are you ready to save?" prompt indicate a change to the Page: Cart template as well as Custom Styles. Unchecking the "Page: Cart" template change will prevent the bug from occurring. Leave it checked to verify the bug.
  9. On saving, the Pattern selection modal will appear.
  10. Visit {siteurl}/cart. Note that the page is completely blank.

What you expected to happen

Making a change in Global Styles should not make any change to the template that is currently being edited.

What actually happened

The edited template is blanked out.

Impact

All

Available workarounds?

Yes, difficult to implement

Platform (Simple and/or Atomic)

Atomic

Logs or notes

No response

masperber commented 3 months ago

Initial report: 8392059-zen

Customer requests followup on resolution.

mrfoxtalbot commented 3 months ago

Thank you for the detailed report @masperber. It sounds like the likely culprit here is the Mini-Cart block, right?

Were you able to replicate this using a different theme?

@Aljullu, are you still working on Woo blocks? If not, who could help triage this? Thank you!

dsas commented 3 months ago

There's some investigation done on this here: p1719520111073669-slack-C02FMH4G8 and https://github.com/Automattic/wp-calypso/issues/91763 has the exact same symptoms

Aljullu commented 3 months ago

@Aljullu, are you still working on Woo blocks? If not, who could help triage this? Thank you!

Thanks for the ping, @mrfoxtalbot!

Note that the "Are you ready to save?" prompt indicate a change to the Page: Cart template as well as Custom Styles.

I was able to replicate the Page: Cart template appearing in the save sidebar unnecessarily, but upon saving nothing weird happened. The template was still there and the frontend still worked.

Pinging Rubik's porter in case he can give it a try as well. cc @mikejolley

Aljullu commented 3 months ago

I was able to replicate the Page: Cart template appearing in the save sidebar unnecessarily

I opened an issue in the WooCommerce repo about this: https://github.com/woocommerce/woocommerce/issues/48936.

dsas commented 3 months ago

The takeaway from the slack thread (p1719520111073669-slack-C02FMH4G8) so far is this:

so far I've only managed to reproduce it on an Atomic site with Zaino, when editing the Cart template and when using the undo button to save more than 2 entities (e.g. template, GS, and footer).

any other combination doesn't trigger the issue for me.

it sounds like a race condition somewhere when saving multiple entities at the same time

It's also reproducible in wp studio, so it's not some dotcom specific thing.

Aljullu commented 3 months ago

Some questions that would be good to know:

  1. Is this reproducible with other WooCommerce templates? Ie: Product Catalog, Single Product, etc. or only with Page: Cart?
  2. Is this reproducible with non-WooCommerce templates? Ie: Blog Home.
  3. Can the issue be reproduced consistently or it happens every other time you try?

In Slack I see some folks mentioned that pressing Undo allows reproducing the issue, but it didn't work for me either. :confused:

cc @roykho as well, as the porter of Origami.

mikejolley commented 3 months ago

I was able to replicate @Aljullu I'll comment on the issue in woo repository.

dsas commented 3 months ago

Is this reproducible with other WooCommerce templates? Ie: Product Catalog, Single Product, etc. or only with Page: Cart?

I've also repro'd it on the page-checkout woo template. I haven't reprod it in Single Product template

Is this reproducible with non-WooCommerce templates? Ie: Blog Home.

I haven't managed to repro it on non-woo templates yet, and neither has any of the other investigators in the slack thread afaik.

Can the issue be reproduced consistently or it happens every other time you try?

Consistently. Here's a video taken first time of asking

https://github.com/Automattic/wp-calypso/assets/93301/b0b28031-05a9-432d-b07d-f0f207f21405

supernovia commented 2 months ago

Quite possibly another case here; their home page template keeps getting blanked: 8513169-zd-a8c

annezazu commented 1 month ago

Is this still a problem? I saw this and it felt incredibly similar to another reported issue: https://github.com/Automattic/wp-calypso/issues/93471 cc @Aljullu @mikejolley @dsas (since you commented on this prior issue too but didn't connect to this).

It looks like new reports haven't come in for a few months either. I tried repeatedly to replicate on a self hosted site and wasn't able to. If the problem can be replicated, I'd like to get it fixed ASAP.

github-actions[bot] commented 1 month ago

Support References

This comment is automatically generated. Please do not edit it.

Aljullu commented 1 month ago

Is this still a problem? I saw this and it felt incredibly similar to another reported issue: https://github.com/Automattic/wp-calypso/issues/93471 cc @Aljullu @mikejolley @dsas (since you commented on this prior issue too but didn't connect to this).

I just tested and I wasn't able to reproduce it, but I wasn't able to consistently reproduce originally either, so I can't confidently say whether it has been solved.

I can consistently reproduce https://github.com/woocommerce/woocommerce/issues/48936, though.

annezazu commented 1 month ago

Okay! I'm going to make the call to close this out then. Let's please reopen if others can replicate. This is a very serious issue to resolve if it remains. I cannot replicate it though and can't see recent reports.