@dxos/echo-pipeline 0.1.57-main.b6e249b → 0.1.57-main.e87098f
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/package.json +32 -32
- package/src/tests/database-unit.test.ts +1 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/echo-pipeline",
|
|
3
|
-
"version": "0.1.57-main.
|
|
3
|
+
"version": "0.1.57-main.e87098f",
|
|
4
4
|
"description": "ECHO database.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -20,43 +20,43 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"crc-32": "^1.2.2",
|
|
23
|
-
"@dxos/async": "0.1.57-main.
|
|
24
|
-
"@dxos/codec-protobuf": "0.1.57-main.
|
|
25
|
-
"@dxos/context": "0.1.57-main.
|
|
26
|
-
"@dxos/credentials": "0.1.57-main.
|
|
27
|
-
"@dxos/crypto": "0.1.57-main.
|
|
28
|
-
"@dxos/debug": "0.1.57-main.
|
|
29
|
-
"@dxos/document-model": "0.1.57-main.
|
|
30
|
-
"@dxos/echo-db": "0.1.57-main.
|
|
31
|
-
"@dxos/errors": "0.1.57-main.
|
|
32
|
-
"@dxos/feed-store": "0.1.57-main.
|
|
33
|
-
"@dxos/hypercore": "0.1.57-main.
|
|
34
|
-
"@dxos/invariant": "0.1.57-main.
|
|
35
|
-
"@dxos/keyring": "0.1.57-main.
|
|
36
|
-
"@dxos/keys": "0.1.57-main.
|
|
37
|
-
"@dxos/log": "0.1.57-main.
|
|
38
|
-
"@dxos/messaging": "0.1.57-main.
|
|
39
|
-
"@dxos/model-factory": "0.1.57-main.
|
|
40
|
-
"@dxos/network-manager": "0.1.57-main.
|
|
41
|
-
"@dxos/node-std": "0.1.57-main.
|
|
42
|
-
"@dxos/protocols": "0.1.57-main.
|
|
43
|
-
"@dxos/random-access-storage": "0.1.57-main.
|
|
44
|
-
"@dxos/rpc": "0.1.57-main.
|
|
45
|
-
"@dxos/teleport": "0.1.57-main.
|
|
46
|
-
"@dxos/teleport-extension-gossip": "0.1.57-main.
|
|
47
|
-
"@dxos/teleport-extension-object-sync": "0.1.57-main.
|
|
48
|
-
"@dxos/teleport-extension-replicator": "0.1.57-main.
|
|
49
|
-
"@dxos/timeframe": "0.1.57-main.
|
|
50
|
-
"@dxos/tracing": "0.1.57-main.
|
|
51
|
-
"@dxos/typings": "0.1.57-main.
|
|
52
|
-
"@dxos/util": "0.1.57-main.
|
|
23
|
+
"@dxos/async": "0.1.57-main.e87098f",
|
|
24
|
+
"@dxos/codec-protobuf": "0.1.57-main.e87098f",
|
|
25
|
+
"@dxos/context": "0.1.57-main.e87098f",
|
|
26
|
+
"@dxos/credentials": "0.1.57-main.e87098f",
|
|
27
|
+
"@dxos/crypto": "0.1.57-main.e87098f",
|
|
28
|
+
"@dxos/debug": "0.1.57-main.e87098f",
|
|
29
|
+
"@dxos/document-model": "0.1.57-main.e87098f",
|
|
30
|
+
"@dxos/echo-db": "0.1.57-main.e87098f",
|
|
31
|
+
"@dxos/errors": "0.1.57-main.e87098f",
|
|
32
|
+
"@dxos/feed-store": "0.1.57-main.e87098f",
|
|
33
|
+
"@dxos/hypercore": "0.1.57-main.e87098f",
|
|
34
|
+
"@dxos/invariant": "0.1.57-main.e87098f",
|
|
35
|
+
"@dxos/keyring": "0.1.57-main.e87098f",
|
|
36
|
+
"@dxos/keys": "0.1.57-main.e87098f",
|
|
37
|
+
"@dxos/log": "0.1.57-main.e87098f",
|
|
38
|
+
"@dxos/messaging": "0.1.57-main.e87098f",
|
|
39
|
+
"@dxos/model-factory": "0.1.57-main.e87098f",
|
|
40
|
+
"@dxos/network-manager": "0.1.57-main.e87098f",
|
|
41
|
+
"@dxos/node-std": "0.1.57-main.e87098f",
|
|
42
|
+
"@dxos/protocols": "0.1.57-main.e87098f",
|
|
43
|
+
"@dxos/random-access-storage": "0.1.57-main.e87098f",
|
|
44
|
+
"@dxos/rpc": "0.1.57-main.e87098f",
|
|
45
|
+
"@dxos/teleport": "0.1.57-main.e87098f",
|
|
46
|
+
"@dxos/teleport-extension-gossip": "0.1.57-main.e87098f",
|
|
47
|
+
"@dxos/teleport-extension-object-sync": "0.1.57-main.e87098f",
|
|
48
|
+
"@dxos/teleport-extension-replicator": "0.1.57-main.e87098f",
|
|
49
|
+
"@dxos/timeframe": "0.1.57-main.e87098f",
|
|
50
|
+
"@dxos/tracing": "0.1.57-main.e87098f",
|
|
51
|
+
"@dxos/typings": "0.1.57-main.e87098f",
|
|
52
|
+
"@dxos/util": "0.1.57-main.e87098f"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"fast-check": "~3.3.0",
|
|
56
56
|
"hypercore-protocol": "^8.0.7",
|
|
57
57
|
"source-map-support": "^0.5.12",
|
|
58
58
|
"wait-for-expect": "^3.0.2",
|
|
59
|
-
"@dxos/text-model": "0.1.57-main.
|
|
59
|
+
"@dxos/text-model": "0.1.57-main.e87098f"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import expect from 'expect';
|
|
6
6
|
|
|
7
|
-
import { sleep } from '@dxos/async';
|
|
8
7
|
import { DocumentModel, MutationBuilder, OrderedArray } from '@dxos/document-model';
|
|
9
|
-
import {
|
|
8
|
+
import { Item, createModelMutation, encodeModelMutation, genesisMutation } from '@dxos/echo-db';
|
|
10
9
|
import { invariant } from '@dxos/invariant';
|
|
11
10
|
import { PublicKey } from '@dxos/keys';
|
|
12
11
|
import { describe, test } from '@dxos/test';
|
|
@@ -248,30 +247,6 @@ describe('database (unit)', () => {
|
|
|
248
247
|
peer1.replicate(peer2.timeframe);
|
|
249
248
|
expect(model.textContent).toBe('Hello DXOS World!');
|
|
250
249
|
});
|
|
251
|
-
|
|
252
|
-
test('consecutive mutations are batched', async () => {
|
|
253
|
-
const rig = new DatabaseTestBuilder();
|
|
254
|
-
const peer = await rig.createPeer();
|
|
255
|
-
|
|
256
|
-
const id = PublicKey.random().toHex();
|
|
257
|
-
peer.proxy.mutate(genesisMutation(id, TextModel.meta.type));
|
|
258
|
-
const model = peer.getModel(id);
|
|
259
|
-
invariant(model instanceof TextModel);
|
|
260
|
-
model.insert('Hello', 0);
|
|
261
|
-
model.insert(' World!', 5);
|
|
262
|
-
// Wait for batch commit.
|
|
263
|
-
await sleep(BATCH_COMMIT_AFTER + 10);
|
|
264
|
-
|
|
265
|
-
// Mutations got merged.
|
|
266
|
-
expect(peer.feedMessages.length).toEqual(1);
|
|
267
|
-
|
|
268
|
-
model.insert(' DXOS', 5);
|
|
269
|
-
// New batch is still not committed.
|
|
270
|
-
expect(peer.feedMessages.length).toEqual(1);
|
|
271
|
-
await sleep(BATCH_COMMIT_AFTER + 10);
|
|
272
|
-
// New batch is committed.
|
|
273
|
-
expect(peer.feedMessages.length).toEqual(2);
|
|
274
|
-
});
|
|
275
250
|
});
|
|
276
251
|
|
|
277
252
|
it('epoch correctly resets items', async () => {
|