Automattic / wp-calypso

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

Cache Flush Resets Admin Color Scheme to Classic Dark #94308

Closed druesome closed 1 month ago

druesome commented 1 month ago

Quick summary

Selecting any Admin Color Scheme in Users > Profile (https://mysite.com/wp-admin/profile.php) updates the colors as expected. However, flushing the cache via CLI resets the scheme to Classic Dark.

Steps to reproduce

  1. On an Atomic site, click Users > Profile (https://mysite.com/wp-admin/profile.php)
  2. Change the Admin Color Scheme to anything other than Classic Dark (preferably something more colorful like Sunrise or Sakura)
  3. Press Update Profile
  4. Notice the change in colors
  5. In a new tab, visit the site's CLI interface at https://mysite.com/_cli
  6. Flush the cache with cache flush
  7. Go back to the tab containing Users > Profile and refresh the page

What you expected to happen

For the currently selected Admin Color Scheme to stay as is.

What actually happened

The Admin Color Scheme switches to Classic Dark and the colors have changed.

Impact

Most (> 50%)

Available workarounds?

No but the platform is still usable

If the above answer is "Yes...", outline the workaround.

No response

Platform (Simple and/or Atomic)

Atomic

Logs or notes

No response

druesome commented 1 month ago

Tickets:

github-actions[bot] commented 1 month ago

Support References

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

m1r0 commented 1 month ago

I can confirm that this happens when wp_cache_flush() is called.

It might be related to https://github.com/Automattic/wpcomsh/pull/1669. @Automattic/lego does this sound like something in your domain?

fushar commented 1 month ago

@Automattic/lego does this sound like something in your domain?

Hi, yep, we can take a look 👍

arthur791004 commented 1 month ago

The issue seems to be gone with the latest WordPress.com Features. Could you help to provide the version of jetpack-mu-wpcom-plugin on client sites? Thank you!

m1r0 commented 1 month ago

Could you help to provide the version of jetpack-mu-wpcom-plugin on client sites?

I'm not that familiar with Atomic. Could you give me a hint of where to look?

If that helps, the wpcomsh plugin (/home/150760296/wordpress/plugins/wpcomsh) version is 5.8.1-alpha. The atomic site that I'm testing is https://m1r0slav82.wpcomstaging.com.

Here's a step-by-step of how I'm testing this bug:

https://github.com/user-attachments/assets/b3b97932-3e8d-4f1e-ba8b-8d344c5ef7f3

To remove the CLI from the picture, I've also tried executing a file https://m1r0slav82.wpcomstaging.com/flush.php which only calls wp_cache_flush(). The result is the same - the scheme is reset.

arthur791004 commented 1 month ago

I confirmed that the reason is the Admin Interface Style is configured to the Default styles. It means the admin color is based on their WordPress.com account.

image

I'll continue to check why updating the color scheme from the profile.php doesn't work correctly

arthur791004 commented 1 month ago

Proposing https://github.com/Automattic/jetpack/pull/39368 to resolve this issue.

druesome commented 1 month ago

Thank you @arthur791004 ! I have notified the users.