Skip to content

Conversation

@markbiek
Copy link
Contributor

Fixes ARC-1294

Proposed Changes

Scenario 1
A CIAB user is attempting to transfer a domain mapping to another user on the same CIAB site. In this case, we only see a "-" since no display name is available and the user id is directly from the CIAB site and is not a WPCOM user id.

image

Scenario 2
A WPCOM user (with a WoA) site is attempting to transfer a domain mapping to another user on the site. The other user was manually created on the site, then attached to a WPCOM account later. In this case, we see the correct display name for the other user but the user id is still directly from the site and is not a WPCOM user id.

The fix
Previously, we called /wp/v2/:siteId/users to populate the "New Owner" pulldown. This (generally) went directly to the remote site.

Now we call the /rest/v1.1/sites/:siteId/users?force=wpcom endpoint. This ensures that we always get the correct WPCOM user data, even in cases like CIAB.

image

Testing Instructions

  • Create a new CIAB site and invite another user to the site.
  • Attach an external domain to the site (no need to setup DNS).
  • Run this locally or use the calypso.live url and visit /ciab/domains/the.external-domain.com/transfer/other-user.
  • Verify that the pulldown contains the correct display name and user id for the other user.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

By default, we force=wpcom to get the user data from WPCOM instead of
the site itself
Previously, we called /wp/v2/:siteId/users which returned the user id
from the site itself (which often wasn't the WPCOM user id).

Now we use the new fetcher to call /rest/v1.1/sites/:siteId/users to get
the user data from WPCOM.
@markbiek markbiek requested review from a team December 11, 2025 18:39
@markbiek markbiek self-assigned this Dec 11, 2025
@markbiek markbiek requested a review from a team as a code owner December 11, 2025 18:39
@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 Dec 11, 2025
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug ARC-1294/transfer-users-list on your sandbox.

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants