Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
ee2c1c2
Use local tree for push
Oct 27, 2025
05b23d9
Use error handling
Oct 28, 2025
6e9e558
Ensure specific selections are added
Oct 28, 2025
2d0dfac
Clean up empty line
Oct 28, 2025
63a1e77
Fix tests
Oct 28, 2025
36f17e1
Optimization
Oct 28, 2025
0472b72
Merge branch 'trunk' of github.com:Automattic/studio into fix/pull-fo…
Oct 28, 2025
8ada7ce
Remove unintended changes
Oct 28, 2025
a1b1837
Pre-fetch the whole tree
Oct 28, 2025
e542b70
Remove duplication
Oct 28, 2025
b67445f
Remove further exclusions
Oct 28, 2025
20b694a
Further improvements
Oct 28, 2025
fe41179
Merge branch 'trunk' of github.com:Automattic/studio into fix/pull-fo…
Oct 29, 2025
22c27ee
Improvements
Oct 29, 2025
6f9dca0
Add missing dependency
Oct 29, 2025
7d81151
Futher improvements
Oct 29, 2025
1a6843a
Resolve directories size error
Oct 29, 2025
2ebef8a
Cleanup
Oct 29, 2025
009ce4a
Merge trunk
Oct 30, 2025
4a72cb2
Refactor
Oct 30, 2025
3c19865
Clean up children and set expansion to true by default
Oct 30, 2025
970dbe1
Oct 31, 2025
db17cb2
Specifically define type order
Oct 31, 2025
98a5752
Remove constants with trailing slashes
Oct 31, 2025
ea1bd16
Fix path concatenation across platforms
Oct 31, 2025
369f7b8
Switch from null to array
Oct 31, 2025
963af9b
Clean up shouldExcludePathFromSync
Oct 31, 2025
a9cfee8
Simplify code and removed unused functions
Oct 31, 2025
30c8bc1
Minor cleanup
Oct 31, 2025
c428577
Rename function to RawDirectoryEntry
Oct 31, 2025
d90828c
Rename function to useTopLevelSyncTree
Oct 31, 2025
224bd8a
Remove an empty array
Oct 31, 2025
2fa32c6
Clean up ternary operator
Oct 31, 2025
df2721d
Clean up checked parameter
Oct 31, 2025
f4e8b0f
Adjust path for windows
Oct 31, 2025
747bece
Remove useMemo
Oct 31, 2025
783c7a3
Remove duplication
Oct 31, 2025
f020ae5
Cleanup code leftovers
Oct 31, 2025
e71ba1b
Solve issue with zip
Nov 3, 2025
6295c1c
Traverse the tree just once
Nov 3, 2025
d2a533e
Clean up repetitions
Nov 3, 2025
36608b7
Minor improvements
Nov 3, 2025
897ebb9
Cleanup
Nov 3, 2025
76fc204
Ensure that categories are constructed in a function
Nov 3, 2025
1ed6095
Improve function name
Nov 3, 2025
026167f
Fix export and minor improvements
Nov 3, 2025
18d80d3
Fix unintended changes
Nov 3, 2025
c226c66
Simplify some selections logic
Nov 3, 2025
66da094
Remove dead code
Nov 3, 2025
928e800
Further simplifications
Nov 3, 2025
7699c01
Merge branch 'trunk' of github.com:Automattic/studio into fix/pull-fo…
Nov 4, 2025
bfbd5fa
Fix selections errors in sync options
Nov 4, 2025
8a79c39
Fix tests on /convert-tree-to-options-to-sync.tsx
Nov 4, 2025
ca775b6
Fix exporter tests
Nov 4, 2025
b3db695
Simplify the function to specificSelectionPaths
Nov 4, 2025
0051c3f
Rename fileNode
Nov 4, 2025
6faa332
Removed unused type
Nov 4, 2025
e6170b7
Adjust git and node modules exclusion
Nov 4, 2025
85aff5d
Move tree props directly in
Nov 4, 2025
9a5ea61
Clean up local tree
Nov 4, 2025
5db98b7
Use descriptive names
Nov 4, 2025
0b3ad02
Ensure that we use curly brackets
Nov 4, 2025
64ecac1
Clean up trailing slashes
Nov 4, 2025
3fd8dce
Ensure that there is no side effects
Nov 4, 2025
d3ae5c4
Fix regex
Nov 4, 2025
4941d23
Pass to backend data for specific folders and files
Nov 5, 2025
8d282d5
Merge branch 'trunk' of github.com:Automattic/studio into fix/send-sp…
Nov 5, 2025
e2af41b
Cleanup
Nov 5, 2025
d0bc1cf
Adjust format
Nov 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/hooks/sync-sites/use-sync-push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ export function useSyncPush( {
const response = await getIpcApi().pushArchive(
remoteSiteId,
archivePath,
options?.optionsToSync
options?.optionsToSync,
options?.specificSelectionPaths
);
const stateAfterUpload = getPushState( selectedSite.id, remoteSiteId );

Expand Down
11 changes: 9 additions & 2 deletions src/ipc-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,8 @@ export async function pushArchive(
event: IpcMainInvokeEvent,
remoteSiteId: number,
archivePath: string,
optionsToSync?: string[]
optionsToSync?: string[],
specificSelectionPaths?: string[]
): Promise< { success: boolean; error?: string } > {
const token = await getAuthenticationToken();

Expand All @@ -824,7 +825,13 @@ export async function pushArchive(
],
];

if ( optionsToSync ) {
if ( specificSelectionPaths && specificSelectionPaths.length > 0 ) {
const options = optionsToSync ? [ ...optionsToSync, 'paths' ] : [ 'paths' ];
formData.push( [ 'options', options.join( ',' ) ] );

const joinedPaths = specificSelectionPaths.join( ',' );
formData.push( [ 'include_path_list', joinedPaths ] );
} else if ( optionsToSync ) {
Comment on lines +828 to +834
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@katinthehatsite , Is there any specific reason we are sending the option paths ?
I think that option is not necessary. For the same reason I would suggest renaming include_path_list var name. Maybe push_selection_paths? 🤔 .

Suggested change
if ( specificSelectionPaths && specificSelectionPaths.length > 0 ) {
const options = optionsToSync ? [ ...optionsToSync, 'paths' ] : [ 'paths' ];
formData.push( [ 'options', options.join( ',' ) ] );
const joinedPaths = specificSelectionPaths.join( ',' );
formData.push( [ 'include_path_list', joinedPaths ] );
} else if ( optionsToSync ) {
if ( specificSelectionPaths && specificSelectionPaths.length > 0 ) {
const joinedPaths = specificSelectionPaths.join( ',' );
formData.push( [ 'push_selection_paths', joinedPaths ] );
}
if ( optionsToSync ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@katinthehatsite , Is there any specific reason we are sending the option paths ?

Don't we need to send SQL which does not come as a part of wp-content so that we can display information regarding the database being pushed to the user?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, this is what we get when choosing database:

optionsToSync [ 'sqls', 'plugins' ]
specificSelectionPaths [ 'plugins/akismet' ]

And this is what we get when choosing all the files:


This is what happens when we select everything:

```optionsToSync [ 'all' ]
specificSelectionPaths undefined

And this is what happens when we select just database:

optionsToSync [ 'sqls' ]
specificSelectionPaths undefined

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment is specific about appending pahts to the options we send to the backend:
const options = optionsToSync ? [ ...optionsToSync, 'paths' ] : [ 'paths' ];

Studio was not using that option before, and AFAIK that option is not necessary.

Copy link
Member

@sejas sejas Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was suspicious of the paths option because the official parameter include_path_list that VaultPress requires needs to be in base64. It seems to me that we are sending both the paths option and the include_path_list to the backend, and then from the backend to VaultPress. However, the include_path_list will actually be ignored because it's not in base64.

Don't we need to send SQL which does not come as a part of wp-content so that we can display information regarding the database being pushed to the user?

Yes, sqls is a valid option, that we need to send when database is checked.

For example, this is what we get when choosing database: ....

Those are correct values ! 👌

formData.push( [ 'options', optionsToSync.join( ',' ) ] );
}

Expand Down
10 changes: 8 additions & 2 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ const api: IpcApi = {
archiveSite: ( id, format ) => ipcRendererInvoke( 'archiveSite', id, format ),
exportSiteForPush: ( id, operationId, configuration ) =>
ipcRendererInvoke( 'exportSiteForPush', id, operationId, configuration ),
pushArchive: ( remoteSiteId, archivePath, optionsToSync ) =>
ipcRendererInvoke( 'pushArchive', remoteSiteId, archivePath, optionsToSync ),
pushArchive: ( remoteSiteId, archivePath, optionsToSync, specificSelectionPaths ) =>
ipcRendererInvoke(
'pushArchive',
remoteSiteId,
archivePath,
optionsToSync,
specificSelectionPaths
),
deleteSite: ( id, deleteFiles ) => ipcRendererInvoke( 'deleteSite', id, deleteFiles ),
createSite: ( path, config ) => ipcRendererInvoke( 'createSite', path, config ),
updateSite: ( updatedSite ) => ipcRendererInvoke( 'updateSite', updatedSite ),
Expand Down
Loading