Repository: Automattic/wp-calypso
Pull request #102394: Transfer with Software: Update prop names to reflect back-end change
Author: login: valterlorran
Created: 2025-04-04T17:02:48Z | Merged: 2025-04-04T18:21:56Z

<!--
Link a related issue to this PR. If the PR does not immediately resolve the issue,
for example, it requires a separate deployment to production, avoid
using the "fixes" keyword and instead attach the [Status] Fix Inbound label to
the linked issue.
-->

Related to 178867-ghe-Automattic/wpcom#discussion_r170519

## Proposed Changes

* Update the naming of the props to not mention Atomic.

## Why are these changes being made?
<!--
It's easy to see what a PR does but much harder to find out why it was made,
particularly when researching old changes in history. Record an explanation of
the motivation behind this change and how it will help.
-->

* Please see 178867-ghe-Automattic/wpcom#discussion_r170519 for more context.

## Testing Instructions

<!--
Add as many details as possible to help others reproduce the issue and test the fix.
"Before / After" screenshots can also be very helpful when the change is visual.
-->

* Visual inspection should be enough.

## Pre-merge Checklist

<!--
Complete applicable items on this checklist **before** merging into trunk. Inapplicable items can be left unchecked.

Both the PR author and reviewer are responsible for ensuring the checklist is completed.
-->

- [ ] Has the general commit checklist been followed? (PCYsg-hS-p2)
- [ ] [Have you written new tests](https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md) 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 used memoizing on expensive computations? More info in [Memoizing with create-selector](https://github.com/Automattic/wp-calypso/blob/trunk/packages/state-utils/src/create-selector/README.md) and [Using memoizing selectors](https://react-redux.js.org/api/hooks#using-memoizing-selectors) and [Our Approach to Data](https://github.com/Automattic/wp-calypso/blob/trunk/docs/our-approach-to-data.md)
- [ ] 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)?


Diff:
diff --git a/client/sites/hooks/test/use-transfer-with-software-start-mutation.tsx b/client/sites/hooks/test/use-transfer-with-software-start-mutation.tsx
index b80137df227a..7f483d0bb001 100644
--- a/client/sites/hooks/test/use-transfer-with-software-start-mutation.tsx
+++ b/client/sites/hooks/test/use-transfer-with-software-start-mutation.tsx
@@ -53,7 +53,7 @@ describe( 'useRequestTransferWithSoftware', () => {
 
 	beforeEach( () => nock.cleanAll() );
 
-	it( 'should successfully request transfer with software and return the atomic_transfer_id', async () => {
+	it( 'should successfully request transfer with software and return the transfer_id', async () => {
 		nock( 'https://public-api.wordpress.com' )
 			.post( '/wpcom/v2/sites/' + SITE_ID + '/atomic/transfer-with-software', {
 				plugins: [ 'plugin-1', 'install' ],
@@ -64,9 +64,9 @@ describe( 'useRequestTransferWithSoftware', () => {
 				http_envelope: 1,
 			} )
 			.reply( 200, {
-				atomic_transfer_id: 456,
+				transfer_id: 456,
 				blog_id: SITE_ID,
-				atomic_transfer_status: 'pending',
+				transfer_status: 'pending',
 			} );
 
 		const { result } = render();
@@ -77,9 +77,9 @@ describe( 'useRequestTransferWithSoftware', () => {
 			() => {
 				expect( result.current.isSuccess ).toBe( true );
 				expect( result.current.data ).toEqual( {
-					atomic_transfer_id: 456,
+					transfer_id: 456,
 					blog_id: SITE_ID,
-					atomic_transfer_status: 'pending',
+					transfer_status: 'pending',
 				} );
 			},
 			{ timeout: 3000 }
diff --git a/client/sites/hooks/test/use-transfer-with-software-status-query.tsx b/client/sites/hooks/test/use-transfer-with-software-status-query.tsx
index ee5c3b5a8122..ec9699351baf 100644
--- a/client/sites/hooks/test/use-transfer-with-software-status-query.tsx
+++ b/client/sites/hooks/test/use-transfer-with-software-status-query.tsx
@@ -15,8 +15,8 @@ jest.mock( '@automattic/calypso-config', () => ( {
 
 const mockSuccessResponse = {
 	blog_id: 123,
-	atomic_transfer_id: 456,
-	atomic_transfer_status: 'completed',
+	transfer_id: 456,
+	transfer_status: 'completed',
 };
 
 describe( 'useTransferWithSoftwareStatus', () => {
@@ -41,7 +41,7 @@ describe( 'useTransferWithSoftwareStatus', () => {
 		await waitFor( () => {
 			expect( result.current.isSuccess ).toBe( true );
 			expect( result.current.data ).toEqual( {
-				atomic_transfer_status: 'completed',
+				transfer_status: 'completed',
 			} );
 		} );
 	} );
@@ -57,7 +57,7 @@ describe( 'useTransferWithSoftwareStatus', () => {
 		expect( nock.isDone() ).toBe( true ); // No pending nock requests
 	} );
 
-	it( 'should not fetch when atomicTransferId is missing', () => {
+	it( 'should not fetch when transferId is missing', () => {
 		const queryClient = new QueryClient();
 		const wrapper = ( { children }: { children: React.ReactNode } ) => (
 			<QueryClientProvider client={ queryClient }>{ children }</QueryClientProvider>
diff --git a/client/sites/hooks/use-transfer-with-software-start-mutation.ts b/client/sites/hooks/use-transfer-with-software-start-mutation.ts
index 2ebf375f3418..1d5bef95f037 100644
--- a/client/sites/hooks/use-transfer-with-software-start-mutation.ts
+++ b/client/sites/hooks/use-transfer-with-software-start-mutation.ts
@@ -3,8 +3,8 @@ import wpcom from 'calypso/lib/wp';
 
 type TransferWithSoftwareResponse = {
 	blog_id: number;
-	atomic_transfer_id: number;
-	atomic_transfer_status: string;
+	transfer_id: number;
+	transfer_status: string;
 };
 
 type SoftwareSlug = string;
diff --git a/client/sites/hooks/use-transfer-with-software-status-query.ts b/client/sites/hooks/use-transfer-with-software-status-query.ts
index 6cb9e03f9f14..831cc08bb2eb 100644
--- a/client/sites/hooks/use-transfer-with-software-status-query.ts
+++ b/client/sites/hooks/use-transfer-with-software-status-query.ts
@@ -3,23 +3,23 @@ import wpcom from 'calypso/lib/wp';
 
 type TransferWithSoftwareStatusResponse = {
 	blog_id: number;
-	atomic_transfer_id: number;
-	atomic_transfer_status: string;
+	transfer_id: number;
+	transfer_status: string;
 };
 
 const getTransferWithSoftwareStatus: (
 	siteId?: number,
-	atomicTransferId?: number
-) => Promise< TransferWithSoftwareStatusResponse > = async ( siteId, atomicTransferId ) => {
-	if ( ! siteId || ! atomicTransferId ) {
+	transferId?: number
+) => Promise< TransferWithSoftwareStatusResponse > = async ( siteId, transferId ) => {
+	if ( ! siteId || ! transferId ) {
 		return {
 			blog_id: 0,
-			atomic_transfer_id: 0,
-			atomic_transfer_status: 'pending',
+			transfer_id: 0,
+			transfer_status: 'pending',
 		};
 	}
 	return wpcom.req.get(
-		`/sites/${ siteId }/atomic/transfer-with-software/${ atomicTransferId }?http_envelope=1`,
+		`/sites/${ siteId }/atomic/transfer-with-software/${ transferId }?http_envelope=1`,
 		{
 			apiNamespace: 'wpcom/v2',
 		}
@@ -28,26 +28,26 @@ const getTransferWithSoftwareStatus: (
 
 export const useTransferWithSoftwareStatus = (
 	siteId?: number,
-	atomicTransferId?: number,
+	transferId?: number,
 	options?: {
 		retry?: UseQueryOptions[ 'retry' ];
 	}
 ) => {
 	return useQuery( {
-		queryKey: [ 'software-transfer-status', siteId, atomicTransferId ],
-		queryFn: () => getTransferWithSoftwareStatus( siteId, atomicTransferId ),
+		queryKey: [ 'software-transfer-status', siteId, transferId ],
+		queryFn: () => getTransferWithSoftwareStatus( siteId, transferId ),
 		select: ( data: TransferWithSoftwareStatusResponse ) => ( {
-			atomic_transfer_status: data.atomic_transfer_status,
+			transfer_status: data.transfer_status,
 		} ),
 		refetchOnWindowFocus: false,
 		refetchOnReconnect: false,
 		refetchInterval: ( { state } ) => {
-			if ( state.data?.atomic_transfer_status === 'completed' ) {
+			if ( state.data?.transfer_status === 'completed' ) {
 				return false;
 			}
 			return 5000;
 		},
 		retry: options?.retry ?? false,
-		enabled: !! siteId && !! atomicTransferId, // Only run when both values exist.
+		enabled: !! siteId && !! transferId, // Only run when both values exist.
 	} );
 };


Reviews:
user: login: copilot-pull-request-reviewer[bot]
body: 

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.


<details>
<summary>Comments suppressed due to low confidence (1)</summary>

**client/sites/hooks/use-transfer-with-software-status-query.ts:37**
* [nitpick] The queryKey still uses 'atomicTransferId', which may lead to confusion given the updated response property names. Consider updating it to 'transferId' if this variable is under your control and reflects the new naming convention.
```
queryKey: [ 'software-transfer-status', siteId, atomicTransferId ],
```
</details>


state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-04T17:03:03Z
user: login: andres-blanco
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-04T17:25:39Z
user: login: andres-blanco
body: LGTM, left a non-blocker nitpick 
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-04T17:27:04Z
user: login: valterlorran
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-04T17:28:44Z
user: login: copilot-pull-request-reviewer[bot]
body: 

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.




state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-04T18:21:26Z

Review comments:
diff_hunk: @@ -37,12 +37,12 @@ export const useTransferWithSoftwareStatus = (
 		queryKey: [ 'software-transfer-status', siteId, atomicTransferId ],
 		queryFn: () => getTransferWithSoftwareStatus( siteId, atomicTransferId ),
path: client/sites/hooks/use-transfer-with-software-status-query.ts
user: login: andres-blanco
body: nit: should this variable be changed to transferId?
created_at: 2025-04-04T17:25:39Z
author_association: CONTRIBUTOR
diff_hunk: @@ -37,12 +37,12 @@ export const useTransferWithSoftwareStatus = (
 		queryKey: [ 'software-transfer-status', siteId, atomicTransferId ],
 		queryFn: () => getTransferWithSoftwareStatus( siteId, atomicTransferId ),
path: client/sites/hooks/use-transfer-with-software-status-query.ts
user: login: valterlorran
body: Yes, I fixed it! Thanks
created_at: 2025-04-04T17:28:44Z
author_association: CONTRIBUTOR

PR comments:
user: login: github-actions[bot]
created_at: 2025-04-04T17:03:01Z
body: <details>
<summary>Calypso Live <a href="https://calypso.live?image=registry.a8c.com/calypso/app:build-139705">(direct link)</a></summary>
<table>
<tr>
<td>
<img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https%3A%2F%2Fcalypso.live%3Fimage%3Dregistry.a8c.com%2Fcalypso%2Fapp%3Abuild-139705%26flags%3Doauth&choe=UTF-8" />
</td>
<td>
<a href="https://calypso.live?image=registry.a8c.com/calypso/app:build-139705">https://calypso.live?image=registry.a8c.com/calypso/app:build-139705</a>
</td>
</tr>
</table>
</details>
<details>
<summary>Jetpack Cloud live <a href="https://calypso.live?image=registry.a8c.com/calypso/app:build-139705&env=jetpack">(direct link)</a></summary>
<table>
<tr>
<td>
<img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https%3A%2F%2Fcalypso.live%3Fimage%3Dregistry.a8c.com%2Fcalypso%2Fapp%3Abuild-139705%26env%3Djetpack%26flags%3Doauth&choe=UTF-8" />
</td>
<td>
<a href="https://calypso.live?image=registry.a8c.com/calypso/app:build-139705&env=jetpack">https://calypso.live?image=registry.a8c.com/calypso/app:build-139705&env=jetpack</a>
</td>
</tr>
</table>
</details>
<details>
<summary>Automattic for Agencies live <a href="https://calypso.live?image=registry.a8c.com/calypso/app:build-139705&env=a8c-for-agencies">(direct link)</a></summary>
<table>
<tr>
<td>
<img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https%3A%2F%2Fcalypso.live%3Fimage%3Dregistry.a8c.com%2Fcalypso%2Fapp%3Abuild-139705%26env%3Da8c-for-agencies%26flags%3Doauth&choe=UTF-8" />
</td>
<td>
<a href="https://calypso.live?image=registry.a8c.com/calypso/app:build-139705&env=a8c-for-agencies">https://calypso.live?image=registry.a8c.com/calypso/app:build-139705&env=a8c-for-agencies</a>
</td>
</tr>
</table>
</details>
<!--calypso-live-watermark:apr@v1-->
author_association: NONE
user: login: matticbot
created_at: 2025-04-04T17:12:44Z
body: <!-- icfy-watermark: c52822 -->
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](http://iscalypsofastyet.com).
author_association: CONTRIBUTOR
user: login: matticbot
created_at: 2025-04-04T17:36:19Z
body: **This PR modifies the release build for the following Calypso Apps:**

_For info about this notification, see here: PCYsg-OT6-p2_

* notifications

To test WordPress.com changes, run `install-plugin.sh $pluginSlug update/transfer-with-software-prop-names` on your sandbox.
<!--calypso-app-artifacts-watermark:apr@v1-->
author_association: CONTRIBUTOR