Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 68 additions & 68 deletions docs/design-docs/sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The backend will send a success email after the push finishes, telling the user

Currently, Studio Sync does not support selective syncing of specific site elements, such as syncing only a single plugin, specific folder, or table. All sync operations involve the entire site, including the full database and wp-content files.

The limit for Jetpack Backup when pushing is 2GB.
The limit for Jetpack Backup when pushing is 5GB.

## Selective Sync Pull

Expand All @@ -94,7 +94,7 @@ GET https://public-api.wordpress.com/wpcom/v2/sites/234098253/studio-app/sync/ge
Response

```json
{"body":{"success":true,"rewind_id":"1753295179"},"status":200,"headers":[]}
{ "body": { "success": true, "rewind_id": "1753295179" }, "status": 200, "headers": [] }
```

Once Studio receives the rewind_id, it requests the files under wp-content. Additional requests are made after the user clicks the arrow to expand a specific folder.
Expand All @@ -104,76 +104,76 @@ POST https://public-api.wordpress.com/wpcom/v2/sites/${ remoteSiteId }/rewind/ba
Payload

```json
{"backup_id":"1753295179","path":"/wp-content/"}
{ "backup_id": "1753295179", "path": "/wp-content/" }
```

Response

```json
{
"body": {
"ok": true,
"error": "",
"contents": {
"mu-plugins": {
"type": "file",
"has_children": true,
"period": "1752575566",
"id": "ZjY6L211LXBsdWdpbnMv",
"total_items": 3
},
"index.php": {
"type": "file",
"has_children": false,
"period": "1747227384",
"id": "ZjY6L2luZGV4LnBocA==",
"manifest_path": "f6:\/index.php"
},
"fonts": {
"type": "file",
"has_children": true,
"period": "1752229230",
"id": "ZjY6L2ZvbnRzLw==",
"total_items": 2
},
"wp-content.php": {
"type": "file",
"has_children": false,
"period": "1752189576",
"id": "ZjY6L3dwLWNvbnRlbnQucGhw",
"manifest_path": "f6:\/wp-content.php"
},
"extra-folder": {
"type": "file",
"has_children": true,
"period": "1752189306",
"id": "ZjY6L2V4dHJhLWZvbGRlci8=",
"total_items": 1
},
"themes": {
"type": "dir",
"has_children": true,
"id": "cjE6,ZjE6Lw==",
"total_items": 234
},
"plugins": {
"type": "dir",
"has_children": true,
"id": "cjI6,ZjI6Lw==",
"total_items": 39
},
"uploads": {
"type": "dir",
"has_children": true,
"id": "ZjM6Lw==",
"total_items": 8
}
}
},
"status": 200,
"headers": {
"Allow": "POST"
}
"body": {
"ok": true,
"error": "",
"contents": {
"mu-plugins": {
"type": "file",
"has_children": true,
"period": "1752575566",
"id": "ZjY6L211LXBsdWdpbnMv",
"total_items": 3
},
"index.php": {
"type": "file",
"has_children": false,
"period": "1747227384",
"id": "ZjY6L2luZGV4LnBocA==",
"manifest_path": "f6:/index.php"
},
"fonts": {
"type": "file",
"has_children": true,
"period": "1752229230",
"id": "ZjY6L2ZvbnRzLw==",
"total_items": 2
},
"wp-content.php": {
"type": "file",
"has_children": false,
"period": "1752189576",
"id": "ZjY6L3dwLWNvbnRlbnQucGhw",
"manifest_path": "f6:/wp-content.php"
},
"extra-folder": {
"type": "file",
"has_children": true,
"period": "1752189306",
"id": "ZjY6L2V4dHJhLWZvbGRlci8=",
"total_items": 1
},
"themes": {
"type": "dir",
"has_children": true,
"id": "cjE6,ZjE6Lw==",
"total_items": 234
},
"plugins": {
"type": "dir",
"has_children": true,
"id": "cjI6,ZjI6Lw==",
"total_items": 39
},
"uploads": {
"type": "dir",
"has_children": true,
"id": "ZjM6Lw==",
"total_items": 8
}
}
},
"status": 200,
"headers": {
"Allow": "POST"
}
}
```

Expand All @@ -183,8 +183,8 @@ For example, if the user selects the database and the fonts folder, the request

```json
{
"options": ["paths", "sqls"],
"include_path_list": ["ZjY6L2ZvbnRzLw=="]
"options": [ "paths", "sqls" ],
"include_path_list": [ "ZjY6L2ZvbnRzLw==" ]
}
```

Expand Down
4 changes: 2 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const SCREENSHOT_HEIGHT = 1248;
export const LIMIT_OF_ZIP_SITES_PER_USER = 10;
export const LIMIT_OF_PROMPTS_PER_USER = 200;
export const UPDATED_MESSAGE_DURATION_MS = 60000; // 1 minute
export const SYNC_PUSH_SIZE_LIMIT_GB = 2;
export const SYNC_PUSH_SIZE_LIMIT_BYTES = SYNC_PUSH_SIZE_LIMIT_GB * 1024 * 1024 * 1024; // 2GB
export const SYNC_PUSH_SIZE_LIMIT_GB = 5;
export const SYNC_PUSH_SIZE_LIMIT_BYTES = SYNC_PUSH_SIZE_LIMIT_GB * 1024 * 1024 * 1024; // 5GB
export const AUTO_UPDATE_INTERVAL_MS = 60 * 60 * 1000;
export const WINDOWS_TITLEBAR_HEIGHT = 32;
export const ABOUT_WINDOW_WIDTH = 300;
Expand Down