cojson-storage-indexeddb 0.14.1 → 0.14.16
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +16 -0
- package/dist/tests/storage.indexeddb.test.js +88 -32
- package/dist/tests/storage.indexeddb.test.js.map +1 -1
- package/dist/tests/testUtils.d.ts +3 -2
- package/dist/tests/testUtils.d.ts.map +1 -1
- package/dist/tests/testUtils.js +11 -4
- package/dist/tests/testUtils.js.map +1 -1
- package/package.json +3 -3
- package/src/tests/storage.indexeddb.test.ts +110 -45
- package/src/tests/testUtils.ts +13 -4
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# cojson-storage-indexeddb
|
|
2
2
|
|
|
3
|
+
## 0.14.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [5e253cc]
|
|
8
|
+
- cojson@0.14.16
|
|
9
|
+
- cojson-storage@0.14.16
|
|
10
|
+
|
|
11
|
+
## 0.14.15
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [23daa7c]
|
|
16
|
+
- cojson-storage@0.14.15
|
|
17
|
+
- cojson@0.14.15
|
|
18
|
+
|
|
3
19
|
## 0.14.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { LocalNode } from "cojson";
|
|
2
2
|
import { StorageManagerAsync } from "cojson-storage";
|
|
3
3
|
import { WasmCrypto } from "cojson/crypto/WasmCrypto";
|
|
4
|
-
import { expect, test, vi } from "vitest";
|
|
4
|
+
import { afterEach, beforeEach, expect, test, vi } from "vitest";
|
|
5
5
|
import { IDBStorage } from "../index.js";
|
|
6
6
|
import { toSimplifiedMessages } from "./messagesTestUtils.js";
|
|
7
7
|
import { trackMessages, waitFor } from "./testUtils.js";
|
|
8
8
|
const Crypto = await WasmCrypto.create();
|
|
9
|
+
let syncMessages;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
syncMessages = trackMessages();
|
|
12
|
+
});
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
syncMessages.restore();
|
|
15
|
+
});
|
|
9
16
|
test("Should be able to initialize and load from empty DB", async () => {
|
|
10
17
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
11
18
|
const node = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
@@ -16,7 +23,6 @@ test("Should be able to initialize and load from empty DB", async () => {
|
|
|
16
23
|
test("should sync and load data from storage", async () => {
|
|
17
24
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
18
25
|
const node1 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
19
|
-
const node1Sync = trackMessages(node1);
|
|
20
26
|
const peer = await IDBStorage.asPeer();
|
|
21
27
|
node1.syncManager.addPeer(peer);
|
|
22
28
|
const group = node1.createGroup();
|
|
@@ -26,7 +32,7 @@ test("should sync and load data from storage", async () => {
|
|
|
26
32
|
expect(toSimplifiedMessages({
|
|
27
33
|
Map: map.core,
|
|
28
34
|
Group: group.core,
|
|
29
|
-
},
|
|
35
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
30
36
|
[
|
|
31
37
|
"client -> CONTENT Group header: true new: After: 0 New: 3",
|
|
32
38
|
"storage -> KNOWN Group sessions: header/3",
|
|
@@ -34,9 +40,9 @@ test("should sync and load data from storage", async () => {
|
|
|
34
40
|
"storage -> KNOWN Map sessions: header/1",
|
|
35
41
|
]
|
|
36
42
|
`);
|
|
37
|
-
|
|
43
|
+
node1.gracefulShutdown();
|
|
44
|
+
syncMessages.clear();
|
|
38
45
|
const node2 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
39
|
-
const node2Sync = trackMessages(node2);
|
|
40
46
|
const peer2 = await IDBStorage.asPeer();
|
|
41
47
|
node2.syncManager.addPeer(peer2);
|
|
42
48
|
const map2 = await node2.load(map.id);
|
|
@@ -47,19 +53,17 @@ test("should sync and load data from storage", async () => {
|
|
|
47
53
|
expect(toSimplifiedMessages({
|
|
48
54
|
Map: map.core,
|
|
49
55
|
Group: group.core,
|
|
50
|
-
},
|
|
56
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
51
57
|
[
|
|
52
58
|
"client -> LOAD Map sessions: empty",
|
|
53
59
|
"storage -> CONTENT Group header: true new: After: 0 New: 3",
|
|
54
60
|
"storage -> CONTENT Map header: true new: After: 0 New: 1",
|
|
55
61
|
]
|
|
56
62
|
`);
|
|
57
|
-
node2Sync.restore();
|
|
58
63
|
});
|
|
59
64
|
test("should send an empty content message if there is no content", async () => {
|
|
60
65
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
61
66
|
const node1 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
62
|
-
const node1Sync = trackMessages(node1);
|
|
63
67
|
const peer = await IDBStorage.asPeer();
|
|
64
68
|
node1.syncManager.addPeer(peer);
|
|
65
69
|
const group = node1.createGroup();
|
|
@@ -68,7 +72,7 @@ test("should send an empty content message if there is no content", async () =>
|
|
|
68
72
|
expect(toSimplifiedMessages({
|
|
69
73
|
Map: map.core,
|
|
70
74
|
Group: group.core,
|
|
71
|
-
},
|
|
75
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
72
76
|
[
|
|
73
77
|
"client -> CONTENT Group header: true new: After: 0 New: 3",
|
|
74
78
|
"storage -> KNOWN Group sessions: header/3",
|
|
@@ -76,9 +80,9 @@ test("should send an empty content message if there is no content", async () =>
|
|
|
76
80
|
"storage -> KNOWN Map sessions: header/0",
|
|
77
81
|
]
|
|
78
82
|
`);
|
|
79
|
-
|
|
83
|
+
syncMessages.clear();
|
|
84
|
+
node1.gracefulShutdown();
|
|
80
85
|
const node2 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
81
|
-
const node2Sync = trackMessages(node2);
|
|
82
86
|
const peer2 = await IDBStorage.asPeer();
|
|
83
87
|
node2.syncManager.addPeer(peer2);
|
|
84
88
|
const map2 = await node2.load(map.id);
|
|
@@ -88,19 +92,17 @@ test("should send an empty content message if there is no content", async () =>
|
|
|
88
92
|
expect(toSimplifiedMessages({
|
|
89
93
|
Map: map.core,
|
|
90
94
|
Group: group.core,
|
|
91
|
-
},
|
|
95
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
92
96
|
[
|
|
93
97
|
"client -> LOAD Map sessions: empty",
|
|
94
98
|
"storage -> CONTENT Group header: true new: After: 0 New: 3",
|
|
95
99
|
"storage -> CONTENT Map header: true new: ",
|
|
96
100
|
]
|
|
97
101
|
`);
|
|
98
|
-
node2Sync.restore();
|
|
99
102
|
});
|
|
100
103
|
test("should load dependencies correctly (group inheritance)", async () => {
|
|
101
104
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
102
105
|
const node1 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
103
|
-
const node1Sync = trackMessages(node1);
|
|
104
106
|
const peer = await IDBStorage.asPeer();
|
|
105
107
|
node1.syncManager.addPeer(peer);
|
|
106
108
|
const group = node1.createGroup();
|
|
@@ -113,7 +115,7 @@ test("should load dependencies correctly (group inheritance)", async () => {
|
|
|
113
115
|
Map: map.core,
|
|
114
116
|
Group: group.core,
|
|
115
117
|
ParentGroup: parentGroup.core,
|
|
116
|
-
},
|
|
118
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
117
119
|
[
|
|
118
120
|
"client -> CONTENT ParentGroup header: true new: After: 0 New: 4",
|
|
119
121
|
"storage -> KNOWN ParentGroup sessions: header/4",
|
|
@@ -123,9 +125,9 @@ test("should load dependencies correctly (group inheritance)", async () => {
|
|
|
123
125
|
"storage -> KNOWN Map sessions: header/1",
|
|
124
126
|
]
|
|
125
127
|
`);
|
|
126
|
-
|
|
128
|
+
syncMessages.clear();
|
|
129
|
+
node1.gracefulShutdown();
|
|
127
130
|
const node2 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
128
|
-
const node2Sync = trackMessages(node2);
|
|
129
131
|
const peer2 = await IDBStorage.asPeer();
|
|
130
132
|
node2.syncManager.addPeer(peer2);
|
|
131
133
|
await node2.load(map.id);
|
|
@@ -136,7 +138,7 @@ test("should load dependencies correctly (group inheritance)", async () => {
|
|
|
136
138
|
Map: map.core,
|
|
137
139
|
Group: group.core,
|
|
138
140
|
ParentGroup: parentGroup.core,
|
|
139
|
-
},
|
|
141
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
140
142
|
[
|
|
141
143
|
"client -> LOAD Map sessions: empty",
|
|
142
144
|
"storage -> CONTENT ParentGroup header: true new: After: 0 New: 4",
|
|
@@ -148,7 +150,6 @@ test("should load dependencies correctly (group inheritance)", async () => {
|
|
|
148
150
|
test("should not send the same dependency value twice", async () => {
|
|
149
151
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
150
152
|
const node1 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
151
|
-
const node1Sync = trackMessages(node1);
|
|
152
153
|
const peer = await IDBStorage.asPeer();
|
|
153
154
|
node1.syncManager.addPeer(peer);
|
|
154
155
|
const group = node1.createGroup();
|
|
@@ -159,9 +160,9 @@ test("should not send the same dependency value twice", async () => {
|
|
|
159
160
|
map.set("hello", "world");
|
|
160
161
|
mapFromParent.set("hello", "world");
|
|
161
162
|
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
162
|
-
|
|
163
|
+
syncMessages.clear();
|
|
164
|
+
node1.gracefulShutdown();
|
|
163
165
|
const node2 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
164
|
-
const node2Sync = trackMessages(node2);
|
|
165
166
|
const peer2 = await IDBStorage.asPeer();
|
|
166
167
|
node2.syncManager.addPeer(peer2);
|
|
167
168
|
await node2.load(map.id);
|
|
@@ -175,7 +176,7 @@ test("should not send the same dependency value twice", async () => {
|
|
|
175
176
|
Group: group.core,
|
|
176
177
|
ParentGroup: parentGroup.core,
|
|
177
178
|
MapFromParent: mapFromParent.core,
|
|
178
|
-
},
|
|
179
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
179
180
|
[
|
|
180
181
|
"client -> LOAD Map sessions: empty",
|
|
181
182
|
"storage -> CONTENT ParentGroup header: true new: After: 0 New: 4",
|
|
@@ -192,7 +193,6 @@ test("should not send the same dependency value twice", async () => {
|
|
|
192
193
|
test("should recover from data loss", async () => {
|
|
193
194
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
194
195
|
const node1 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
195
|
-
const node1Sync = trackMessages(node1);
|
|
196
196
|
const peer = await IDBStorage.asPeer();
|
|
197
197
|
node1.syncManager.addPeer(peer);
|
|
198
198
|
const group = node1.createGroup();
|
|
@@ -211,7 +211,7 @@ test("should recover from data loss", async () => {
|
|
|
211
211
|
expect(toSimplifiedMessages({
|
|
212
212
|
Map: map.core,
|
|
213
213
|
Group: group.core,
|
|
214
|
-
},
|
|
214
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
215
215
|
[
|
|
216
216
|
"client -> CONTENT Group header: true new: After: 0 New: 3",
|
|
217
217
|
"storage -> KNOWN Group sessions: header/3",
|
|
@@ -223,9 +223,9 @@ test("should recover from data loss", async () => {
|
|
|
223
223
|
"storage -> KNOWN Map sessions: header/4",
|
|
224
224
|
]
|
|
225
225
|
`);
|
|
226
|
-
|
|
226
|
+
syncMessages.clear();
|
|
227
|
+
node1.gracefulShutdown();
|
|
227
228
|
const node2 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
228
|
-
const node2Sync = trackMessages(node2);
|
|
229
229
|
const peer2 = await IDBStorage.asPeer();
|
|
230
230
|
node2.syncManager.addPeer(peer2);
|
|
231
231
|
const map2 = await node2.load(map.id);
|
|
@@ -241,7 +241,7 @@ test("should recover from data loss", async () => {
|
|
|
241
241
|
expect(toSimplifiedMessages({
|
|
242
242
|
Map: map.core,
|
|
243
243
|
Group: group.core,
|
|
244
|
-
},
|
|
244
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
245
245
|
[
|
|
246
246
|
"client -> LOAD Map sessions: empty",
|
|
247
247
|
"storage -> CONTENT Group header: true new: After: 0 New: 3",
|
|
@@ -269,7 +269,7 @@ test("should sync multiple sessions in a single content message", async () => {
|
|
|
269
269
|
await map2.core.waitForSync();
|
|
270
270
|
node2.gracefulShutdown();
|
|
271
271
|
const node3 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
272
|
-
|
|
272
|
+
syncMessages.clear();
|
|
273
273
|
node3.syncManager.addPeer(await IDBStorage.asPeer());
|
|
274
274
|
const map3 = await node3.load(map.id);
|
|
275
275
|
if (map3 === "unavailable") {
|
|
@@ -279,14 +279,13 @@ test("should sync multiple sessions in a single content message", async () => {
|
|
|
279
279
|
expect(toSimplifiedMessages({
|
|
280
280
|
Map: map.core,
|
|
281
281
|
Group: group.core,
|
|
282
|
-
},
|
|
282
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
283
283
|
[
|
|
284
284
|
"client -> LOAD Map sessions: empty",
|
|
285
285
|
"storage -> CONTENT Group header: true new: After: 0 New: 3",
|
|
286
286
|
"storage -> CONTENT Map header: true new: After: 0 New: 1 | After: 0 New: 1",
|
|
287
287
|
]
|
|
288
288
|
`);
|
|
289
|
-
node3Sync.restore();
|
|
290
289
|
});
|
|
291
290
|
test("large coValue upload streaming", async () => {
|
|
292
291
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
@@ -307,7 +306,7 @@ test("large coValue upload streaming", async () => {
|
|
|
307
306
|
const knownState = largeMap.core.knownState();
|
|
308
307
|
node1.gracefulShutdown();
|
|
309
308
|
const node2 = new LocalNode(agentSecret, Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)), Crypto);
|
|
310
|
-
|
|
309
|
+
syncMessages.clear();
|
|
311
310
|
node2.syncManager.addPeer(await IDBStorage.asPeer());
|
|
312
311
|
const largeMapOnNode2 = await node2.load(largeMap.id);
|
|
313
312
|
if (largeMapOnNode2 === "unavailable") {
|
|
@@ -320,7 +319,7 @@ test("large coValue upload streaming", async () => {
|
|
|
320
319
|
expect(toSimplifiedMessages({
|
|
321
320
|
Map: largeMap.core,
|
|
322
321
|
Group: group.core,
|
|
323
|
-
},
|
|
322
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
324
323
|
[
|
|
325
324
|
"client -> LOAD Map sessions: empty",
|
|
326
325
|
"storage -> KNOWN Map sessions: header/200",
|
|
@@ -335,4 +334,61 @@ test("large coValue upload streaming", async () => {
|
|
|
335
334
|
]
|
|
336
335
|
`);
|
|
337
336
|
});
|
|
337
|
+
test("should sync and load accounts from storage", async () => {
|
|
338
|
+
const agentSecret = Crypto.newRandomAgentSecret();
|
|
339
|
+
const { node: node1, accountID } = await LocalNode.withNewlyCreatedAccount({
|
|
340
|
+
crypto: Crypto,
|
|
341
|
+
initialAgentSecret: agentSecret,
|
|
342
|
+
peersToLoadFrom: [await IDBStorage.asPeer()],
|
|
343
|
+
creationProps: {
|
|
344
|
+
name: "test",
|
|
345
|
+
},
|
|
346
|
+
});
|
|
347
|
+
const account1 = node1.getCoValue(accountID);
|
|
348
|
+
const profile = node1.expectProfileLoaded(accountID);
|
|
349
|
+
const profileGroup = profile.group;
|
|
350
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
351
|
+
expect(toSimplifiedMessages({
|
|
352
|
+
Account: account1,
|
|
353
|
+
Profile: profile.core,
|
|
354
|
+
ProfileGroup: profileGroup.core,
|
|
355
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
356
|
+
[
|
|
357
|
+
"client -> CONTENT Account header: true new: After: 0 New: 4",
|
|
358
|
+
"storage -> KNOWN Account sessions: header/4",
|
|
359
|
+
"client -> CONTENT ProfileGroup header: true new: After: 0 New: 5",
|
|
360
|
+
"storage -> KNOWN ProfileGroup sessions: header/5",
|
|
361
|
+
"client -> CONTENT Profile header: true new: After: 0 New: 1",
|
|
362
|
+
"storage -> KNOWN Profile sessions: header/1",
|
|
363
|
+
]
|
|
364
|
+
`);
|
|
365
|
+
node1.gracefulShutdown();
|
|
366
|
+
syncMessages.restore();
|
|
367
|
+
syncMessages = trackMessages();
|
|
368
|
+
const node2 = await LocalNode.withLoadedAccount({
|
|
369
|
+
crypto: Crypto,
|
|
370
|
+
accountSecret: agentSecret,
|
|
371
|
+
accountID,
|
|
372
|
+
peersToLoadFrom: [await IDBStorage.asPeer()],
|
|
373
|
+
sessionID: Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)),
|
|
374
|
+
});
|
|
375
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
376
|
+
expect(toSimplifiedMessages({
|
|
377
|
+
Account: account1,
|
|
378
|
+
Profile: profile.core,
|
|
379
|
+
ProfileGroup: profileGroup.core,
|
|
380
|
+
}, syncMessages.messages)).toMatchInlineSnapshot(`
|
|
381
|
+
[
|
|
382
|
+
"client -> LOAD Account sessions: empty",
|
|
383
|
+
"storage -> CONTENT Account header: true new: After: 0 New: 4",
|
|
384
|
+
"client -> KNOWN Account sessions: header/4",
|
|
385
|
+
"client -> LOAD Profile sessions: empty",
|
|
386
|
+
"storage -> CONTENT ProfileGroup header: true new: After: 0 New: 5",
|
|
387
|
+
"storage -> CONTENT Profile header: true new: After: 0 New: 1",
|
|
388
|
+
"client -> KNOWN ProfileGroup sessions: header/5",
|
|
389
|
+
"client -> KNOWN Profile sessions: header/1",
|
|
390
|
+
]
|
|
391
|
+
`);
|
|
392
|
+
expect(node2.getCoValue(accountID).isAvailable()).toBeTruthy();
|
|
393
|
+
});
|
|
338
394
|
//# sourceMappingURL=storage.indexeddb.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.indexeddb.test.js","sourceRoot":"","sources":["../../src/tests/storage.indexeddb.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC;AAEzC,IAAI,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;IACrE,MAAM,WAAW,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC;IAElD,MAAM,IAAI,GAAG,IAAI,SAAS,CACxB,WAAW,EACX,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,EACzD,MAAM,CACP,CAAC;IAEF,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;IAEpD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IAEzD,MAAM,CAAC,IAAI,CAAC,WAAW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AAC,UAAU,EAAE,CAAC;AACjE,CAAC,CAAC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function trackMessages(
|
|
1
|
+
import type { SyncMessage } from "cojson";
|
|
2
|
+
export declare function trackMessages(): {
|
|
3
3
|
messages: {
|
|
4
4
|
from: "client" | "server" | "storage";
|
|
5
5
|
msg: SyncMessage;
|
|
6
6
|
}[];
|
|
7
7
|
restore: () => void;
|
|
8
|
+
clear: () => void;
|
|
8
9
|
};
|
|
9
10
|
export declare function waitFor(callback: () => boolean | undefined | Promise<boolean | undefined>): Promise<void>;
|
|
10
11
|
//# sourceMappingURL=testUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testUtils.d.ts","sourceRoot":"","sources":["../../src/tests/testUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"testUtils.d.ts","sourceRoot":"","sources":["../../src/tests/testUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,QAAQ,CAAC;AAOrD,wBAAgB,aAAa;;cAEnB,QAAQ,GAAG,QAAQ,GAAG,SAAS;aAChC,WAAW;;;;EA0CnB;AAED,wBAAgB,OAAO,CACrB,QAAQ,EAAE,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,iBA2BnE"}
|
package/dist/tests/testUtils.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { cojsonInternals } from "cojson";
|
|
1
2
|
import { StorageManagerAsync } from "cojson-storage";
|
|
2
3
|
import { onTestFinished } from "vitest";
|
|
3
|
-
|
|
4
|
+
const { SyncManager } = cojsonInternals;
|
|
5
|
+
export function trackMessages() {
|
|
4
6
|
const messages = [];
|
|
5
7
|
const originalHandleSyncMessage = StorageManagerAsync.prototype.handleSyncMessage;
|
|
6
|
-
const originalNodeSyncMessage =
|
|
8
|
+
const originalNodeSyncMessage = SyncManager.prototype.handleSyncMessage;
|
|
7
9
|
StorageManagerAsync.prototype.handleSyncMessage = async function (msg) {
|
|
8
10
|
messages.push({
|
|
9
11
|
from: "client",
|
|
@@ -11,7 +13,7 @@ export function trackMessages(node) {
|
|
|
11
13
|
});
|
|
12
14
|
return originalHandleSyncMessage.call(this, msg);
|
|
13
15
|
};
|
|
14
|
-
|
|
16
|
+
SyncManager.prototype.handleSyncMessage = async function (msg, peer) {
|
|
15
17
|
messages.push({
|
|
16
18
|
from: "storage",
|
|
17
19
|
msg,
|
|
@@ -20,7 +22,11 @@ export function trackMessages(node) {
|
|
|
20
22
|
};
|
|
21
23
|
const restore = () => {
|
|
22
24
|
StorageManagerAsync.prototype.handleSyncMessage = originalHandleSyncMessage;
|
|
23
|
-
|
|
25
|
+
SyncManager.prototype.handleSyncMessage = originalNodeSyncMessage;
|
|
26
|
+
messages.length = 0;
|
|
27
|
+
};
|
|
28
|
+
const clear = () => {
|
|
29
|
+
messages.length = 0;
|
|
24
30
|
};
|
|
25
31
|
onTestFinished(() => {
|
|
26
32
|
restore();
|
|
@@ -28,6 +34,7 @@ export function trackMessages(node) {
|
|
|
28
34
|
return {
|
|
29
35
|
messages,
|
|
30
36
|
restore,
|
|
37
|
+
clear,
|
|
31
38
|
};
|
|
32
39
|
}
|
|
33
40
|
export function waitFor(callback) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testUtils.js","sourceRoot":"","sources":["../../src/tests/testUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,
|
|
1
|
+
{"version":3,"file":"testUtils.js","sourceRoot":"","sources":["../../src/tests/testUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,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O;QACP,KAAK;KACN,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,QAAkE;IAElE,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,MAAM,WAAW,GAAG,KAAK,IAAI,EAAE;YAC7B,IAAI,CAAC;gBACH,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YAC/C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC;QAEF,IAAI,OAAO,GAAG,CAAC,CAAC;QAEhB,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;YACtC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,MAAM,WAAW,EAAE,CAAC;YAE1C,IAAI,EAAE,KAAK,KAAK,EAAE,CAAC;gBACjB,aAAa,CAAC,QAAQ,CAAC,CAAC;gBACxB,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,CAAC;gBACnB,aAAa,CAAC,QAAQ,CAAC,CAAC;gBACxB,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC;QACH,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cojson-storage-indexeddb",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.16",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"cojson": "0.14.
|
|
10
|
-
"cojson-storage": "0.14.
|
|
9
|
+
"cojson": "0.14.16",
|
|
10
|
+
"cojson-storage": "0.14.16"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"typescript": "5.6.2",
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { LocalNode } from "cojson";
|
|
2
2
|
import { StorageManagerAsync } from "cojson-storage";
|
|
3
3
|
import { WasmCrypto } from "cojson/crypto/WasmCrypto";
|
|
4
|
-
import { expect, test, vi } from "vitest";
|
|
4
|
+
import { afterEach, beforeEach, expect, test, vi } from "vitest";
|
|
5
5
|
import { IDBStorage } from "../index.js";
|
|
6
6
|
import { toSimplifiedMessages } from "./messagesTestUtils.js";
|
|
7
7
|
import { trackMessages, waitFor } from "./testUtils.js";
|
|
8
8
|
|
|
9
9
|
const Crypto = await WasmCrypto.create();
|
|
10
|
+
let syncMessages: ReturnType<typeof trackMessages>;
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
syncMessages = trackMessages();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
afterEach(() => {
|
|
17
|
+
syncMessages.restore();
|
|
18
|
+
});
|
|
10
19
|
|
|
11
20
|
test("Should be able to initialize and load from empty DB", async () => {
|
|
12
21
|
const agentSecret = Crypto.newRandomAgentSecret();
|
|
@@ -33,8 +42,6 @@ test("should sync and load data from storage", async () => {
|
|
|
33
42
|
Crypto,
|
|
34
43
|
);
|
|
35
44
|
|
|
36
|
-
const node1Sync = trackMessages(node1);
|
|
37
|
-
|
|
38
45
|
const peer = await IDBStorage.asPeer();
|
|
39
46
|
|
|
40
47
|
node1.syncManager.addPeer(peer);
|
|
@@ -53,7 +60,7 @@ test("should sync and load data from storage", async () => {
|
|
|
53
60
|
Map: map.core,
|
|
54
61
|
Group: group.core,
|
|
55
62
|
},
|
|
56
|
-
|
|
63
|
+
syncMessages.messages,
|
|
57
64
|
),
|
|
58
65
|
).toMatchInlineSnapshot(`
|
|
59
66
|
[
|
|
@@ -64,7 +71,8 @@ test("should sync and load data from storage", async () => {
|
|
|
64
71
|
]
|
|
65
72
|
`);
|
|
66
73
|
|
|
67
|
-
|
|
74
|
+
node1.gracefulShutdown();
|
|
75
|
+
syncMessages.clear();
|
|
68
76
|
|
|
69
77
|
const node2 = new LocalNode(
|
|
70
78
|
agentSecret,
|
|
@@ -72,8 +80,6 @@ test("should sync and load data from storage", async () => {
|
|
|
72
80
|
Crypto,
|
|
73
81
|
);
|
|
74
82
|
|
|
75
|
-
const node2Sync = trackMessages(node2);
|
|
76
|
-
|
|
77
83
|
const peer2 = await IDBStorage.asPeer();
|
|
78
84
|
|
|
79
85
|
node2.syncManager.addPeer(peer2);
|
|
@@ -91,7 +97,7 @@ test("should sync and load data from storage", async () => {
|
|
|
91
97
|
Map: map.core,
|
|
92
98
|
Group: group.core,
|
|
93
99
|
},
|
|
94
|
-
|
|
100
|
+
syncMessages.messages,
|
|
95
101
|
),
|
|
96
102
|
).toMatchInlineSnapshot(`
|
|
97
103
|
[
|
|
@@ -100,8 +106,6 @@ test("should sync and load data from storage", async () => {
|
|
|
100
106
|
"storage -> CONTENT Map header: true new: After: 0 New: 1",
|
|
101
107
|
]
|
|
102
108
|
`);
|
|
103
|
-
|
|
104
|
-
node2Sync.restore();
|
|
105
109
|
});
|
|
106
110
|
|
|
107
111
|
test("should send an empty content message if there is no content", async () => {
|
|
@@ -113,8 +117,6 @@ test("should send an empty content message if there is no content", async () =>
|
|
|
113
117
|
Crypto,
|
|
114
118
|
);
|
|
115
119
|
|
|
116
|
-
const node1Sync = trackMessages(node1);
|
|
117
|
-
|
|
118
120
|
const peer = await IDBStorage.asPeer();
|
|
119
121
|
|
|
120
122
|
node1.syncManager.addPeer(peer);
|
|
@@ -131,7 +133,7 @@ test("should send an empty content message if there is no content", async () =>
|
|
|
131
133
|
Map: map.core,
|
|
132
134
|
Group: group.core,
|
|
133
135
|
},
|
|
134
|
-
|
|
136
|
+
syncMessages.messages,
|
|
135
137
|
),
|
|
136
138
|
).toMatchInlineSnapshot(`
|
|
137
139
|
[
|
|
@@ -142,7 +144,8 @@ test("should send an empty content message if there is no content", async () =>
|
|
|
142
144
|
]
|
|
143
145
|
`);
|
|
144
146
|
|
|
145
|
-
|
|
147
|
+
syncMessages.clear();
|
|
148
|
+
node1.gracefulShutdown();
|
|
146
149
|
|
|
147
150
|
const node2 = new LocalNode(
|
|
148
151
|
agentSecret,
|
|
@@ -150,8 +153,6 @@ test("should send an empty content message if there is no content", async () =>
|
|
|
150
153
|
Crypto,
|
|
151
154
|
);
|
|
152
155
|
|
|
153
|
-
const node2Sync = trackMessages(node2);
|
|
154
|
-
|
|
155
156
|
const peer2 = await IDBStorage.asPeer();
|
|
156
157
|
|
|
157
158
|
node2.syncManager.addPeer(peer2);
|
|
@@ -167,7 +168,7 @@ test("should send an empty content message if there is no content", async () =>
|
|
|
167
168
|
Map: map.core,
|
|
168
169
|
Group: group.core,
|
|
169
170
|
},
|
|
170
|
-
|
|
171
|
+
syncMessages.messages,
|
|
171
172
|
),
|
|
172
173
|
).toMatchInlineSnapshot(`
|
|
173
174
|
[
|
|
@@ -176,8 +177,6 @@ test("should send an empty content message if there is no content", async () =>
|
|
|
176
177
|
"storage -> CONTENT Map header: true new: ",
|
|
177
178
|
]
|
|
178
179
|
`);
|
|
179
|
-
|
|
180
|
-
node2Sync.restore();
|
|
181
180
|
});
|
|
182
181
|
|
|
183
182
|
test("should load dependencies correctly (group inheritance)", async () => {
|
|
@@ -189,8 +188,6 @@ test("should load dependencies correctly (group inheritance)", async () => {
|
|
|
189
188
|
Crypto,
|
|
190
189
|
);
|
|
191
190
|
|
|
192
|
-
const node1Sync = trackMessages(node1);
|
|
193
|
-
|
|
194
191
|
const peer = await IDBStorage.asPeer();
|
|
195
192
|
|
|
196
193
|
node1.syncManager.addPeer(peer);
|
|
@@ -213,7 +210,7 @@ test("should load dependencies correctly (group inheritance)", async () => {
|
|
|
213
210
|
Group: group.core,
|
|
214
211
|
ParentGroup: parentGroup.core,
|
|
215
212
|
},
|
|
216
|
-
|
|
213
|
+
syncMessages.messages,
|
|
217
214
|
),
|
|
218
215
|
).toMatchInlineSnapshot(`
|
|
219
216
|
[
|
|
@@ -226,7 +223,8 @@ test("should load dependencies correctly (group inheritance)", async () => {
|
|
|
226
223
|
]
|
|
227
224
|
`);
|
|
228
225
|
|
|
229
|
-
|
|
226
|
+
syncMessages.clear();
|
|
227
|
+
node1.gracefulShutdown();
|
|
230
228
|
|
|
231
229
|
const node2 = new LocalNode(
|
|
232
230
|
agentSecret,
|
|
@@ -234,8 +232,6 @@ test("should load dependencies correctly (group inheritance)", async () => {
|
|
|
234
232
|
Crypto,
|
|
235
233
|
);
|
|
236
234
|
|
|
237
|
-
const node2Sync = trackMessages(node2);
|
|
238
|
-
|
|
239
235
|
const peer2 = await IDBStorage.asPeer();
|
|
240
236
|
|
|
241
237
|
node2.syncManager.addPeer(peer2);
|
|
@@ -253,7 +249,7 @@ test("should load dependencies correctly (group inheritance)", async () => {
|
|
|
253
249
|
Group: group.core,
|
|
254
250
|
ParentGroup: parentGroup.core,
|
|
255
251
|
},
|
|
256
|
-
|
|
252
|
+
syncMessages.messages,
|
|
257
253
|
),
|
|
258
254
|
).toMatchInlineSnapshot(`
|
|
259
255
|
[
|
|
@@ -274,8 +270,6 @@ test("should not send the same dependency value twice", async () => {
|
|
|
274
270
|
Crypto,
|
|
275
271
|
);
|
|
276
272
|
|
|
277
|
-
const node1Sync = trackMessages(node1);
|
|
278
|
-
|
|
279
273
|
const peer = await IDBStorage.asPeer();
|
|
280
274
|
|
|
281
275
|
node1.syncManager.addPeer(peer);
|
|
@@ -293,7 +287,8 @@ test("should not send the same dependency value twice", async () => {
|
|
|
293
287
|
|
|
294
288
|
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
295
289
|
|
|
296
|
-
|
|
290
|
+
syncMessages.clear();
|
|
291
|
+
node1.gracefulShutdown();
|
|
297
292
|
|
|
298
293
|
const node2 = new LocalNode(
|
|
299
294
|
agentSecret,
|
|
@@ -301,8 +296,6 @@ test("should not send the same dependency value twice", async () => {
|
|
|
301
296
|
Crypto,
|
|
302
297
|
);
|
|
303
298
|
|
|
304
|
-
const node2Sync = trackMessages(node2);
|
|
305
|
-
|
|
306
299
|
const peer2 = await IDBStorage.asPeer();
|
|
307
300
|
|
|
308
301
|
node2.syncManager.addPeer(peer2);
|
|
@@ -323,7 +316,7 @@ test("should not send the same dependency value twice", async () => {
|
|
|
323
316
|
ParentGroup: parentGroup.core,
|
|
324
317
|
MapFromParent: mapFromParent.core,
|
|
325
318
|
},
|
|
326
|
-
|
|
319
|
+
syncMessages.messages,
|
|
327
320
|
),
|
|
328
321
|
).toMatchInlineSnapshot(`
|
|
329
322
|
[
|
|
@@ -349,8 +342,6 @@ test("should recover from data loss", async () => {
|
|
|
349
342
|
Crypto,
|
|
350
343
|
);
|
|
351
344
|
|
|
352
|
-
const node1Sync = trackMessages(node1);
|
|
353
|
-
|
|
354
345
|
const peer = await IDBStorage.asPeer();
|
|
355
346
|
|
|
356
347
|
node1.syncManager.addPeer(peer);
|
|
@@ -384,7 +375,7 @@ test("should recover from data loss", async () => {
|
|
|
384
375
|
Map: map.core,
|
|
385
376
|
Group: group.core,
|
|
386
377
|
},
|
|
387
|
-
|
|
378
|
+
syncMessages.messages,
|
|
388
379
|
),
|
|
389
380
|
).toMatchInlineSnapshot(`
|
|
390
381
|
[
|
|
@@ -399,7 +390,8 @@ test("should recover from data loss", async () => {
|
|
|
399
390
|
]
|
|
400
391
|
`);
|
|
401
392
|
|
|
402
|
-
|
|
393
|
+
syncMessages.clear();
|
|
394
|
+
node1.gracefulShutdown();
|
|
403
395
|
|
|
404
396
|
const node2 = new LocalNode(
|
|
405
397
|
agentSecret,
|
|
@@ -407,8 +399,6 @@ test("should recover from data loss", async () => {
|
|
|
407
399
|
Crypto,
|
|
408
400
|
);
|
|
409
401
|
|
|
410
|
-
const node2Sync = trackMessages(node2);
|
|
411
|
-
|
|
412
402
|
const peer2 = await IDBStorage.asPeer();
|
|
413
403
|
|
|
414
404
|
node2.syncManager.addPeer(peer2);
|
|
@@ -432,7 +422,7 @@ test("should recover from data loss", async () => {
|
|
|
432
422
|
Map: map.core,
|
|
433
423
|
Group: group.core,
|
|
434
424
|
},
|
|
435
|
-
|
|
425
|
+
syncMessages.messages,
|
|
436
426
|
),
|
|
437
427
|
).toMatchInlineSnapshot(`
|
|
438
428
|
[
|
|
@@ -491,7 +481,7 @@ test("should sync multiple sessions in a single content message", async () => {
|
|
|
491
481
|
Crypto,
|
|
492
482
|
);
|
|
493
483
|
|
|
494
|
-
|
|
484
|
+
syncMessages.clear();
|
|
495
485
|
|
|
496
486
|
node3.syncManager.addPeer(await IDBStorage.asPeer());
|
|
497
487
|
|
|
@@ -508,7 +498,7 @@ test("should sync multiple sessions in a single content message", async () => {
|
|
|
508
498
|
Map: map.core,
|
|
509
499
|
Group: group.core,
|
|
510
500
|
},
|
|
511
|
-
|
|
501
|
+
syncMessages.messages,
|
|
512
502
|
),
|
|
513
503
|
).toMatchInlineSnapshot(`
|
|
514
504
|
[
|
|
@@ -517,8 +507,6 @@ test("should sync multiple sessions in a single content message", async () => {
|
|
|
517
507
|
"storage -> CONTENT Map header: true new: After: 0 New: 1 | After: 0 New: 1",
|
|
518
508
|
]
|
|
519
509
|
`);
|
|
520
|
-
|
|
521
|
-
node3Sync.restore();
|
|
522
510
|
});
|
|
523
511
|
|
|
524
512
|
test("large coValue upload streaming", async () => {
|
|
@@ -559,7 +547,7 @@ test("large coValue upload streaming", async () => {
|
|
|
559
547
|
Crypto,
|
|
560
548
|
);
|
|
561
549
|
|
|
562
|
-
|
|
550
|
+
syncMessages.clear();
|
|
563
551
|
|
|
564
552
|
node2.syncManager.addPeer(await IDBStorage.asPeer());
|
|
565
553
|
|
|
@@ -581,7 +569,7 @@ test("large coValue upload streaming", async () => {
|
|
|
581
569
|
Map: largeMap.core,
|
|
582
570
|
Group: group.core,
|
|
583
571
|
},
|
|
584
|
-
|
|
572
|
+
syncMessages.messages,
|
|
585
573
|
),
|
|
586
574
|
).toMatchInlineSnapshot(`
|
|
587
575
|
[
|
|
@@ -598,3 +586,80 @@ test("large coValue upload streaming", async () => {
|
|
|
598
586
|
]
|
|
599
587
|
`);
|
|
600
588
|
});
|
|
589
|
+
|
|
590
|
+
test("should sync and load accounts from storage", async () => {
|
|
591
|
+
const agentSecret = Crypto.newRandomAgentSecret();
|
|
592
|
+
|
|
593
|
+
const { node: node1, accountID } = await LocalNode.withNewlyCreatedAccount({
|
|
594
|
+
crypto: Crypto,
|
|
595
|
+
initialAgentSecret: agentSecret,
|
|
596
|
+
peersToLoadFrom: [await IDBStorage.asPeer()],
|
|
597
|
+
creationProps: {
|
|
598
|
+
name: "test",
|
|
599
|
+
},
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
const account1 = node1.getCoValue(accountID);
|
|
603
|
+
const profile = node1.expectProfileLoaded(accountID);
|
|
604
|
+
const profileGroup = profile.group;
|
|
605
|
+
|
|
606
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
607
|
+
|
|
608
|
+
expect(
|
|
609
|
+
toSimplifiedMessages(
|
|
610
|
+
{
|
|
611
|
+
Account: account1,
|
|
612
|
+
Profile: profile.core,
|
|
613
|
+
ProfileGroup: profileGroup.core,
|
|
614
|
+
},
|
|
615
|
+
syncMessages.messages,
|
|
616
|
+
),
|
|
617
|
+
).toMatchInlineSnapshot(`
|
|
618
|
+
[
|
|
619
|
+
"client -> CONTENT Account header: true new: After: 0 New: 4",
|
|
620
|
+
"storage -> KNOWN Account sessions: header/4",
|
|
621
|
+
"client -> CONTENT ProfileGroup header: true new: After: 0 New: 5",
|
|
622
|
+
"storage -> KNOWN ProfileGroup sessions: header/5",
|
|
623
|
+
"client -> CONTENT Profile header: true new: After: 0 New: 1",
|
|
624
|
+
"storage -> KNOWN Profile sessions: header/1",
|
|
625
|
+
]
|
|
626
|
+
`);
|
|
627
|
+
|
|
628
|
+
node1.gracefulShutdown();
|
|
629
|
+
syncMessages.restore();
|
|
630
|
+
syncMessages = trackMessages();
|
|
631
|
+
|
|
632
|
+
const node2 = await LocalNode.withLoadedAccount({
|
|
633
|
+
crypto: Crypto,
|
|
634
|
+
accountSecret: agentSecret,
|
|
635
|
+
accountID,
|
|
636
|
+
peersToLoadFrom: [await IDBStorage.asPeer()],
|
|
637
|
+
sessionID: Crypto.newRandomSessionID(Crypto.getAgentID(agentSecret)),
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
await new Promise((resolve) => setTimeout(resolve, 200));
|
|
641
|
+
|
|
642
|
+
expect(
|
|
643
|
+
toSimplifiedMessages(
|
|
644
|
+
{
|
|
645
|
+
Account: account1,
|
|
646
|
+
Profile: profile.core,
|
|
647
|
+
ProfileGroup: profileGroup.core,
|
|
648
|
+
},
|
|
649
|
+
syncMessages.messages,
|
|
650
|
+
),
|
|
651
|
+
).toMatchInlineSnapshot(`
|
|
652
|
+
[
|
|
653
|
+
"client -> LOAD Account sessions: empty",
|
|
654
|
+
"storage -> CONTENT Account header: true new: After: 0 New: 4",
|
|
655
|
+
"client -> KNOWN Account sessions: header/4",
|
|
656
|
+
"client -> LOAD Profile sessions: empty",
|
|
657
|
+
"storage -> CONTENT ProfileGroup header: true new: After: 0 New: 5",
|
|
658
|
+
"storage -> CONTENT Profile header: true new: After: 0 New: 1",
|
|
659
|
+
"client -> KNOWN ProfileGroup sessions: header/5",
|
|
660
|
+
"client -> KNOWN Profile sessions: header/1",
|
|
661
|
+
]
|
|
662
|
+
`);
|
|
663
|
+
|
|
664
|
+
expect(node2.getCoValue(accountID).isAvailable()).toBeTruthy();
|
|
665
|
+
});
|
package/src/tests/testUtils.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { LocalNode, SyncMessage } from "cojson";
|
|
2
|
+
import { cojsonInternals } from "cojson";
|
|
2
3
|
import { StorageManagerAsync } from "cojson-storage";
|
|
3
4
|
import { onTestFinished } from "vitest";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
const { SyncManager } = cojsonInternals;
|
|
7
|
+
|
|
8
|
+
export function trackMessages() {
|
|
6
9
|
const messages: {
|
|
7
10
|
from: "client" | "server" | "storage";
|
|
8
11
|
msg: SyncMessage;
|
|
@@ -10,7 +13,7 @@ export function trackMessages(node: LocalNode) {
|
|
|
10
13
|
|
|
11
14
|
const originalHandleSyncMessage =
|
|
12
15
|
StorageManagerAsync.prototype.handleSyncMessage;
|
|
13
|
-
const originalNodeSyncMessage =
|
|
16
|
+
const originalNodeSyncMessage = SyncManager.prototype.handleSyncMessage;
|
|
14
17
|
|
|
15
18
|
StorageManagerAsync.prototype.handleSyncMessage = async function (msg) {
|
|
16
19
|
messages.push({
|
|
@@ -20,7 +23,7 @@ export function trackMessages(node: LocalNode) {
|
|
|
20
23
|
return originalHandleSyncMessage.call(this, msg);
|
|
21
24
|
};
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
SyncManager.prototype.handleSyncMessage = async function (msg, peer) {
|
|
24
27
|
messages.push({
|
|
25
28
|
from: "storage",
|
|
26
29
|
msg,
|
|
@@ -30,7 +33,12 @@ export function trackMessages(node: LocalNode) {
|
|
|
30
33
|
|
|
31
34
|
const restore = () => {
|
|
32
35
|
StorageManagerAsync.prototype.handleSyncMessage = originalHandleSyncMessage;
|
|
33
|
-
|
|
36
|
+
SyncManager.prototype.handleSyncMessage = originalNodeSyncMessage;
|
|
37
|
+
messages.length = 0;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const clear = () => {
|
|
41
|
+
messages.length = 0;
|
|
34
42
|
};
|
|
35
43
|
|
|
36
44
|
onTestFinished(() => {
|
|
@@ -40,6 +48,7 @@ export function trackMessages(node: LocalNode) {
|
|
|
40
48
|
return {
|
|
41
49
|
messages,
|
|
42
50
|
restore,
|
|
51
|
+
clear,
|
|
43
52
|
};
|
|
44
53
|
}
|
|
45
54
|
|