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

People: Update name value for Jetpack/Atomic sites to point to most up to date source #58140

Closed
wants to merge 1 commit into from

Conversation

sixhours
Copy link
Contributor

Changes proposed in this Pull Request

  • Jetpack/Atomic sites sync data to WP.com mirror sites, but after the initial sync, not all data gets sent.
  • Jetpack Sync only checks for changes in the user ID and capabilities after the initial sync; if a site gets disconnected, the rest of the user data does not get updated on reconnection/resync.
  • This means you can end up in a situation where the People page on a Jetpack/Atomic site displays an old, out of date display name for a user, if the user updated their display name on WP.com while their Jetpack/Atomic site was disconnected.
  • ...but we can access the most up-to-date name value via the API in a linked_user_info object that comes directly from WP.com's user info rather than the site's, so pointing to that value on the front end for Jetpack/Atomic sites shows the correct name, even if the synced site data is incorrect. If there's a mismatch, the user doesn't need to know about it.
  • This is not a fix for the syncing problem, but a stopgap for showing the most up-to-date user info on the front end.

Fixes #55175

Before

Red lines indicate the old, incorrect display name, name we want to display indicated by a green arrow:

Screen Shot 2021-11-16 at 2 33 32 PM

After

Green lines indicate the correct display name is now shown:

Screen Shot 2021-11-16 at 2 34 50 PM

Testing instructions

  • Spin up an Atomic test site
  • Note your current Display Name under /me and visit your test site's people admin: /people/team/[site] -- you'll see your Display Name listed as a user
  • Disconnect the Atomic test site from Jetpack via CLI: wp jetpack disconnect blog
  • Update your Display Name under /me to something new
  • Go back to /people/team/[site] and you'll see the old Display Name value
  • Reconnect your site to Jetpack from /wp-admin -- the old Display Name value will persist at /people/team/[site]
  • Switch to this PR and view /people/team/[site]; you'll see the correct, updated Display Name.

@sixhours sixhours self-assigned this Nov 16, 2021
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Nov 16, 2021
@github-actions
Copy link

@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~13 bytes added 📈 [gzipped])

name    parsed_size           gzip_size
people        +46 B  (+0.0%)      +13 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@sixhours
Copy link
Contributor Author

Ahh darn, I just realized this doesn't solve the problem, really. Because there are more places (ie. /posts) where the incorrect username will still be displayed. Unless we catch all instances of the Display name across Calypso, a front-end approach probably won't work. I'll keep investigating the backend approach.

@sixhours sixhours closed this Nov 16, 2021
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Nov 16, 2021
@sixhours sixhours deleted the fix/users-jetpack-name-data branch February 8, 2023 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display Name Not Updating Across Atomic Site
2 participants