@kumiai/rpc 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commit.d.ts +11 -0
- package/lib/peer.js +4 -2
- package/package.json +5 -5
package/lib/commit.d.ts
CHANGED
|
@@ -110,12 +110,23 @@ export type CommitJournal = {
|
|
|
110
110
|
* reconstructed, so the host must re-issue or tell the user. For a remove the notice is
|
|
111
111
|
* security-relevant: an admin who believes a member was evicted when they were not has no other
|
|
112
112
|
* signal.
|
|
113
|
+
*
|
|
114
|
+
* Both carry `journal`, the host's own blob from the lost entry, because both obligations are
|
|
115
|
+
* about a specific operation the host started: re-issuing the right tokens, or telling the user
|
|
116
|
+
* which action did not happen. The peer holds nothing else that names it — the `build()` closure
|
|
117
|
+
* died with its process, and the tokens are the work, not the request. Handing back the kind
|
|
118
|
+
* alone would say only that SOMETHING was lost.
|
|
119
|
+
*
|
|
120
|
+
* It is the same blob `adoptJournalled` receives when a commit lands, and deliberately so: a host
|
|
121
|
+
* reads its own bookkeeping the same way on both outcomes, and the two paths stay symmetric.
|
|
113
122
|
*/
|
|
114
123
|
export type LostCommit = {
|
|
115
124
|
kind: 'ledger';
|
|
116
125
|
tokens: Array<string>;
|
|
126
|
+
journal: Uint8Array;
|
|
117
127
|
} | {
|
|
118
128
|
kind: 'invite' | 'remove';
|
|
129
|
+
journal: Uint8Array;
|
|
119
130
|
};
|
|
120
131
|
/**
|
|
121
132
|
* What a lane operation found that the host must act on. Always a RETURN VALUE, never a callback:
|
package/lib/peer.js
CHANGED
|
@@ -1081,9 +1081,11 @@ export function createGroupPeer(params) {
|
|
|
1081
1081
|
await journal.clear(entry.publishID);
|
|
1082
1082
|
lostCommit = entry.kind === 'ledger' ? {
|
|
1083
1083
|
kind: 'ledger',
|
|
1084
|
-
tokens: entry.bodies
|
|
1084
|
+
tokens: entry.bodies,
|
|
1085
|
+
journal: entry.journal
|
|
1085
1086
|
} : {
|
|
1086
|
-
kind: entry.kind
|
|
1087
|
+
kind: entry.kind,
|
|
1088
|
+
journal: entry.journal
|
|
1087
1089
|
};
|
|
1088
1090
|
return false;
|
|
1089
1091
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kumiai/rpc",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "High-level MLS-aware group RPC for Enkaku: bus broadcast/anycast/gather plus directed RPC over the pub/sub hub",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rpc",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"@sozai/log": "^0.2.0",
|
|
36
36
|
"@sozai/runtime": "^0.1.0",
|
|
37
37
|
"@kumiai/broadcast": "^0.4.0",
|
|
38
|
-
"@kumiai/hub-
|
|
39
|
-
"@kumiai/hub-
|
|
38
|
+
"@kumiai/hub-tunnel": "^0.4.0",
|
|
39
|
+
"@kumiai/hub-protocol": "^0.4.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@noble/curves": "^2.0.1",
|
|
43
43
|
"vitest": "^4.1.10",
|
|
44
|
-
"@kumiai/
|
|
45
|
-
"@kumiai/
|
|
44
|
+
"@kumiai/rpc-conformance": "^0.4.0",
|
|
45
|
+
"@kumiai/hub-conformance": "^0.4.0"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
|