Skip to content

Commit 8ef8683

Browse files
committed
client-replica: the first release
This is a squashed commit of following commits. The squash is due to massive conflict. add apitest to github actions (#1591) test: add puterjs test to apiteste (#1590) client-replica: local read, replica init update proto definition client-replica: update the tree structure pick package.json (root + puterjs) from main client-replica: got the same hash algo on js and go client-replica: update design and api client-replica: update design, add rpc PullDiff client-replica: update pull/push requests client-replica: use string hash client-replica: remove bigint hash client-replica: update code format client-replica: update rpc client-replica: use user_id instead of user_name client-replica: fix root path, add integrity check client-replica: force pull client-replica: update design, aligh implementation with it client-replica: simplified socket logic client-replica: add purge logic to server.go, update rpc client-replica: purge logic client-replica: draft hook for rename, too many pitfalls client-replica: add parent_uid patch to move client-replica: inject failure to server.go client-replica: tidy debug code client-replica: remove api InitReplica (generated by mistake) client-replica: update doc comments client-replica: reorg backend fs_tree_manager client-replica: update hooks, udpate api name client-replica: fatal -> panic client-replica: update RemoveFSEntry client-replica: use map children_uuids to avoid duplicate client-replica: update children_uuids in js client-replica: update doc comments clietn-replica: update doc comments client-replica: refactor fs_tree_manager, add config client-replica: add mysql support client-replica: update config client-replica: add missing lock client-replica: update the RFC client-replica: update chaos mode client-replica: remove some logs client-replica: deal with dir rename/move, update hooks client-replica: update docs
1 parent b6e1276 commit 8ef8683

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+6933
-187
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,13 @@ jsconfig.json
4545
# the exact tree installed in the node_modules folder
4646
package-lock.json
4747

48+
# ======================================================================
49+
# fs tree manager
50+
# ======================================================================
51+
src/fs_tree_manager/config.yaml
52+
53+
# ======================================================================
54+
# other
55+
# ======================================================================
4856
AGENTS.md
4957
.roo

doc/RFCS/20250821_client_replica_file_system.md

Lines changed: 382 additions & 0 deletions
Large diffs are not rendered by default.

doc/RFCS/assets/20251008_134412_puter-client_replica_overview.drawio.svg

Lines changed: 4 additions & 0 deletions
Loading

doc/RFCS/assets/20251008_134726_puter-client_replica_network.drawio.svg

Lines changed: 4 additions & 0 deletions
Loading

doc/RFCS/assets/20251008_134849_puter-client_replica_deployment1.drawio.svg

Lines changed: 4 additions & 0 deletions
Loading

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,14 @@
5959
"@aws-sdk/client-secrets-manager": "^3.879.0",
6060
"@aws-sdk/client-sns": "^3.907.0",
6161
"@google/genai": "^1.19.0",
62+
"@grpc/grpc-js": "^1.14.0",
6263
"@heyputer/putility": "^1.0.2",
6364
"@paralleldrive/cuid2": "^2.2.2",
6465
"@stylistic/eslint-plugin-js": "^4.4.1",
6566
"dedent": "^1.5.3",
6667
"express-xml-bodyparser": "^0.4.1",
68+
"google-protobuf": "^4.0.0",
69+
"grpc-tools": "^1.13.0",
6770
"ioredis": "^5.6.0",
6871
"javascript-time-ago": "^2.5.11",
6972
"json-colorizer": "^3.0.1",
@@ -72,7 +75,8 @@
7275
"rollup": "^4.52.4",
7376
"simple-git": "^3.25.0",
7477
"string-template": "^1.0.0",
75-
"uuid": "^9.0.1"
78+
"uuid": "^9.0.1",
79+
"xxhash-wasm": "^1.1.0"
7680
},
7781
"optionalDependencies": {
7882
"sharp": "^0.34.4",

src/backend/src/filesystem/hl_operations/hl_copy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ class HLCopy extends HLFilesystemOperation {
216216

217217
await this.copied.awaitStableEntry();
218218
const response = await this.copied.getSafeEntry({ thumbnail: true });
219+
219220
return {
220221
copied : response,
221222
overwritten

src/backend/src/filesystem/hl_operations/hl_mkdir.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const { is_valid_path } = require('../validation');
3232
const { HLRemove } = require('./hl_remove');
3333
const { LLMkdir } = require('../ll_operations/ll_mkdir');
3434

35+
3536
class MkTree extends HLFilesystemOperation {
3637
static DESCRIPTION = `
3738
High-level operation for making directory trees
@@ -378,7 +379,10 @@ class HLMkdir extends HLFilesystemOperation {
378379
});
379380

380381
await this.created.awaitStableEntry();
381-
return await this.created.getSafeEntry();
382+
const response = await this.created.getSafeEntry();
383+
384+
385+
return response;
382386
}
383387

384388
const ll_mkdir = new LLMkdir();
@@ -402,6 +406,7 @@ class HLMkdir extends HLFilesystemOperation {
402406
}
403407
response.requested_path = values.path;
404408

409+
405410
return response;
406411
}
407412

src/backend/src/filesystem/hl_operations/hl_mklink.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ class HLMkLink extends HLFilesystemOperation {
6969
});
7070

7171
await created.awaitStableEntry();
72-
return await created.getSafeEntry();
72+
const response = await created.getSafeEntry();
73+
74+
return response;
7375
}
7476
}
7577

src/backend/src/filesystem/hl_operations/hl_mkshortcut.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ class HLMkShortcut extends HLFilesystemOperation {
9898
});
9999

100100
await created.awaitStableEntry();
101-
return await created.getSafeEntry();
101+
const response = await created.getSafeEntry();
102+
103+
return response;
102104
}
103105
}
104106

0 commit comments

Comments
 (0)