@dxos/echo-pipeline 0.3.3-main.44bdbf7 → 0.3.3-main.619fab4
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/dist/lib/browser/{chunk-KD6OVLI6.mjs → chunk-7IXNAFKL.mjs} +16 -74
- package/dist/lib/browser/chunk-7IXNAFKL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +2 -4
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +60 -118
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +66 -126
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/types/src/db-host/data-service-host.d.ts +2 -10
- package/dist/types/src/db-host/data-service-host.d.ts.map +1 -1
- package/dist/types/src/db-host/database-host.d.ts +2 -2
- package/dist/types/src/db-host/database-host.d.ts.map +1 -1
- package/package.json +31 -31
- package/src/db-host/data-service-host.ts +9 -90
- package/src/db-host/database-host.ts +3 -9
- package/src/testing/database-test-rig.ts +1 -1
- package/dist/lib/browser/chunk-KD6OVLI6.mjs.map +0 -7
|
@@ -103,7 +103,6 @@ var TestFeedBuilder = class extends import_testing.TestBuilder {
|
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
// packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts
|
|
106
|
-
var import_async = require("@dxos/async");
|
|
107
106
|
var import_codec_protobuf = require("@dxos/codec-protobuf");
|
|
108
107
|
var import_context = require("@dxos/context");
|
|
109
108
|
var import_echo_db = require("@dxos/echo-db");
|
|
@@ -112,14 +111,12 @@ var import_log = require("@dxos/log");
|
|
|
112
111
|
var import_service = require("@dxos/protocols/proto/dxos/echo/service");
|
|
113
112
|
var import_util = require("@dxos/util");
|
|
114
113
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/db-host/data-service-host.ts";
|
|
115
|
-
var MUTATION_LIMIT_PER_OBJECT = 10;
|
|
116
114
|
var DataServiceHost = class {
|
|
117
|
-
constructor(_itemManager, _itemDemuxer, _flush, _writeStream
|
|
115
|
+
constructor(_itemManager, _itemDemuxer, _flush, _writeStream) {
|
|
118
116
|
this._itemManager = _itemManager;
|
|
119
117
|
this._itemDemuxer = _itemDemuxer;
|
|
120
118
|
this._flush = _flush;
|
|
121
119
|
this._writeStream = _writeStream;
|
|
122
|
-
this._opts = _opts;
|
|
123
120
|
this._ctx = new import_context.Context();
|
|
124
121
|
this._clientTagMap = new import_util.ComplexMap(([feedKey, seq]) => `${feedKey.toHex()}:${seq}`);
|
|
125
122
|
}
|
|
@@ -128,9 +125,6 @@ var DataServiceHost = class {
|
|
|
128
125
|
async close() {
|
|
129
126
|
await this._ctx.dispose();
|
|
130
127
|
}
|
|
131
|
-
get _deferEvents() {
|
|
132
|
-
return this._opts.deferEvents ?? true;
|
|
133
|
-
}
|
|
134
128
|
/**
|
|
135
129
|
* Real-time subscription to data objects in a space.
|
|
136
130
|
*/
|
|
@@ -143,43 +137,7 @@ var DataServiceHost = class {
|
|
|
143
137
|
objects
|
|
144
138
|
}
|
|
145
139
|
});
|
|
146
|
-
const updateScheduler = new import_async.UpdateScheduler(ctx, async () => {
|
|
147
|
-
flushPendingUpdate();
|
|
148
|
-
}, {
|
|
149
|
-
maxFrequency: 10
|
|
150
|
-
});
|
|
151
|
-
const pendingUpdates = [];
|
|
152
|
-
const mutationsPerObject = /* @__PURE__ */ new Map();
|
|
153
|
-
const clearPendingUpdates = () => {
|
|
154
|
-
pendingUpdates.length = 0;
|
|
155
|
-
mutationsPerObject.clear();
|
|
156
|
-
};
|
|
157
|
-
const flushPendingUpdate = () => {
|
|
158
|
-
const stagedEvents = [];
|
|
159
|
-
const objectsWithSnapshots = /* @__PURE__ */ new Set();
|
|
160
|
-
for (const [id, count] of mutationsPerObject) {
|
|
161
|
-
if (count >= MUTATION_LIMIT_PER_OBJECT) {
|
|
162
|
-
objectsWithSnapshots.add(id);
|
|
163
|
-
const entity = this._itemManager.entities.get(id);
|
|
164
|
-
if (entity) {
|
|
165
|
-
stagedEvents.push(entity.createSnapshot());
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
for (const obj of pendingUpdates) {
|
|
170
|
-
if (!objectsWithSnapshots.has(obj.objectId)) {
|
|
171
|
-
stagedEvents.push(obj);
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
next({
|
|
175
|
-
batch: {
|
|
176
|
-
objects: stagedEvents
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
clearPendingUpdates();
|
|
180
|
-
};
|
|
181
140
|
this._itemDemuxer.snapshot.on(ctx, (snapshot) => {
|
|
182
|
-
clearPendingUpdates();
|
|
183
141
|
next({
|
|
184
142
|
action: import_service.EchoEvent.DatabaseAction.RESET,
|
|
185
143
|
batch: {
|
|
@@ -191,7 +149,7 @@ var DataServiceHost = class {
|
|
|
191
149
|
const { batch, meta } = message;
|
|
192
150
|
(0, import_invariant2.invariant)(!meta.clientTag, "Unexpected client tag in mutation message", {
|
|
193
151
|
F: __dxlog_file2,
|
|
194
|
-
L:
|
|
152
|
+
L: 69,
|
|
195
153
|
S: this,
|
|
196
154
|
A: [
|
|
197
155
|
"!(meta as any).clientTag",
|
|
@@ -203,7 +161,7 @@ var DataServiceHost = class {
|
|
|
203
161
|
meta
|
|
204
162
|
}, {
|
|
205
163
|
F: __dxlog_file2,
|
|
206
|
-
L:
|
|
164
|
+
L: 70,
|
|
207
165
|
S: this,
|
|
208
166
|
C: (f, a) => f(...a)
|
|
209
167
|
});
|
|
@@ -217,37 +175,21 @@ var DataServiceHost = class {
|
|
|
217
175
|
});
|
|
218
176
|
});
|
|
219
177
|
if (clientTag) {
|
|
220
|
-
flushPendingUpdate();
|
|
221
178
|
(0, import_echo_db.tagMutationsInBatch)(batch, clientTag, 0);
|
|
222
|
-
next({
|
|
223
|
-
clientTag,
|
|
224
|
-
feedKey: message.meta.feedKey,
|
|
225
|
-
seq: message.meta.seq,
|
|
226
|
-
batch
|
|
227
|
-
});
|
|
228
|
-
} else {
|
|
229
|
-
for (const obj of batch.objects ?? []) {
|
|
230
|
-
const newCount = (mutationsPerObject.get(obj.objectId) ?? 0) + 1;
|
|
231
|
-
mutationsPerObject.set(obj.objectId, newCount);
|
|
232
|
-
}
|
|
233
|
-
for (const obj of batch.objects ?? []) {
|
|
234
|
-
if ((mutationsPerObject.get(obj.objectId) ?? 0) < MUTATION_LIMIT_PER_OBJECT) {
|
|
235
|
-
pendingUpdates.push(obj);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
if (this._deferEvents) {
|
|
239
|
-
updateScheduler.trigger();
|
|
240
|
-
} else {
|
|
241
|
-
flushPendingUpdate();
|
|
242
|
-
}
|
|
243
179
|
}
|
|
180
|
+
next({
|
|
181
|
+
clientTag,
|
|
182
|
+
feedKey: message.meta.feedKey,
|
|
183
|
+
seq: message.meta.seq,
|
|
184
|
+
batch
|
|
185
|
+
});
|
|
244
186
|
});
|
|
245
187
|
});
|
|
246
188
|
}
|
|
247
189
|
async write(request) {
|
|
248
190
|
(0, import_invariant2.invariant)(!this._ctx.disposed, "Cannot write to closed DataServiceHost", {
|
|
249
191
|
F: __dxlog_file2,
|
|
250
|
-
L:
|
|
192
|
+
L: 96,
|
|
251
193
|
S: this,
|
|
252
194
|
A: [
|
|
253
195
|
"!this._ctx.disposed",
|
|
@@ -256,7 +198,7 @@ var DataServiceHost = class {
|
|
|
256
198
|
});
|
|
257
199
|
(0, import_invariant2.invariant)(this._writeStream, "Cannot write mutations in readonly mode", {
|
|
258
200
|
F: __dxlog_file2,
|
|
259
|
-
L:
|
|
201
|
+
L: 97,
|
|
260
202
|
S: this,
|
|
261
203
|
A: [
|
|
262
204
|
"this._writeStream",
|
|
@@ -268,7 +210,7 @@ var DataServiceHost = class {
|
|
|
268
210
|
objectCount: request.batch.objects?.length ?? 0
|
|
269
211
|
}, {
|
|
270
212
|
F: __dxlog_file2,
|
|
271
|
-
L:
|
|
213
|
+
L: 99,
|
|
272
214
|
S: this,
|
|
273
215
|
C: (f, a) => f(...a)
|
|
274
216
|
});
|
|
@@ -282,7 +224,7 @@ var DataServiceHost = class {
|
|
|
282
224
|
seq: receipt2.seq
|
|
283
225
|
}, {
|
|
284
226
|
F: __dxlog_file2,
|
|
285
|
-
L:
|
|
227
|
+
L: 108,
|
|
286
228
|
S: this,
|
|
287
229
|
C: (f, a) => f(...a)
|
|
288
230
|
});
|
|
@@ -339,8 +281,8 @@ var DatabaseHost = class {
|
|
|
339
281
|
createSnapshot() {
|
|
340
282
|
return this._itemDemuxer.createSnapshot();
|
|
341
283
|
}
|
|
342
|
-
createDataServiceHost(
|
|
343
|
-
return new DataServiceHost(this._itemManager, this._itemDemuxer, this._flush, this._outboundStream ?? void 0
|
|
284
|
+
createDataServiceHost() {
|
|
285
|
+
return new DataServiceHost(this._itemManager, this._itemDemuxer, this._flush, this._outboundStream ?? void 0);
|
|
344
286
|
}
|
|
345
287
|
};
|
|
346
288
|
|
|
@@ -533,7 +475,7 @@ var DataServiceImpl = class {
|
|
|
533
475
|
|
|
534
476
|
// packages/core/echo/echo-pipeline/src/metadata/metadata-store.ts
|
|
535
477
|
var import_crc_32 = __toESM(require("crc-32"));
|
|
536
|
-
var
|
|
478
|
+
var import_async = require("@dxos/async");
|
|
537
479
|
var import_invariant4 = require("@dxos/invariant");
|
|
538
480
|
var import_keys3 = require("@dxos/keys");
|
|
539
481
|
var import_log3 = require("@dxos/log");
|
|
@@ -566,7 +508,7 @@ var MetadataStore = class {
|
|
|
566
508
|
this._metadata = emptyEchoMetadata();
|
|
567
509
|
this._spaceLargeMetadata = new import_util3.ComplexMap(import_keys3.PublicKey.hash);
|
|
568
510
|
this._metadataFile = void 0;
|
|
569
|
-
this.update = new
|
|
511
|
+
this.update = new import_async.Event();
|
|
570
512
|
}
|
|
571
513
|
get metadata() {
|
|
572
514
|
return this._metadata;
|
|
@@ -825,18 +767,18 @@ var MetadataStore = class {
|
|
|
825
767
|
}
|
|
826
768
|
};
|
|
827
769
|
_ts_decorate([
|
|
828
|
-
|
|
770
|
+
import_async.synchronized
|
|
829
771
|
], MetadataStore.prototype, "load", null);
|
|
830
772
|
_ts_decorate([
|
|
831
|
-
|
|
773
|
+
import_async.synchronized
|
|
832
774
|
], MetadataStore.prototype, "_save", null);
|
|
833
775
|
_ts_decorate([
|
|
834
|
-
|
|
776
|
+
import_async.synchronized
|
|
835
777
|
], MetadataStore.prototype, "_saveSpaceLargeMetadata", null);
|
|
836
778
|
var fromBytesInt32 = (buf) => buf.readInt32LE(0);
|
|
837
779
|
|
|
838
780
|
// packages/core/echo/echo-pipeline/src/space/auth.ts
|
|
839
|
-
var
|
|
781
|
+
var import_async2 = require("@dxos/async");
|
|
840
782
|
var import_context3 = require("@dxos/context");
|
|
841
783
|
var import_crypto2 = require("@dxos/crypto");
|
|
842
784
|
var import_invariant5 = require("@dxos/invariant");
|
|
@@ -894,7 +836,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
|
|
|
894
836
|
}
|
|
895
837
|
async onOpen(context) {
|
|
896
838
|
await super.onOpen(context);
|
|
897
|
-
(0,
|
|
839
|
+
(0, import_async2.scheduleTask)(this._ctx, async () => {
|
|
898
840
|
try {
|
|
899
841
|
const challenge = (0, import_crypto2.randomBytes)(32);
|
|
900
842
|
const { credential } = await this.rpc.AuthService.authenticate({
|
|
@@ -919,7 +861,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
|
|
|
919
861
|
"'credential not verified'"
|
|
920
862
|
]
|
|
921
863
|
});
|
|
922
|
-
(0,
|
|
864
|
+
(0, import_async2.runInContext)(this._ctx, () => this._authParams.onAuthSuccess());
|
|
923
865
|
} catch (err) {
|
|
924
866
|
(0, import_log4.log)("auth failed", err, {
|
|
925
867
|
F: __dxlog_file5,
|
|
@@ -943,7 +885,7 @@ var AuthExtension = class extends import_teleport.RpcExtension {
|
|
|
943
885
|
};
|
|
944
886
|
|
|
945
887
|
// packages/core/echo/echo-pipeline/src/space/space.ts
|
|
946
|
-
var
|
|
888
|
+
var import_async7 = require("@dxos/async");
|
|
947
889
|
var import_invariant9 = require("@dxos/invariant");
|
|
948
890
|
var import_log10 = require("@dxos/log");
|
|
949
891
|
var import_credentials4 = require("@dxos/protocols/proto/dxos/halo/credentials");
|
|
@@ -951,7 +893,7 @@ var import_tracing3 = require("@dxos/tracing");
|
|
|
951
893
|
var import_util7 = require("@dxos/util");
|
|
952
894
|
|
|
953
895
|
// packages/core/echo/echo-pipeline/src/space/control-pipeline.ts
|
|
954
|
-
var
|
|
896
|
+
var import_async5 = require("@dxos/async");
|
|
955
897
|
var import_context5 = require("@dxos/context");
|
|
956
898
|
var import_credentials = require("@dxos/credentials");
|
|
957
899
|
var import_keys5 = require("@dxos/keys");
|
|
@@ -962,7 +904,7 @@ var import_tracing = require("@dxos/tracing");
|
|
|
962
904
|
var import_util5 = require("@dxos/util");
|
|
963
905
|
|
|
964
906
|
// packages/core/echo/echo-pipeline/src/pipeline/pipeline.ts
|
|
965
|
-
var
|
|
907
|
+
var import_async4 = require("@dxos/async");
|
|
966
908
|
var import_context4 = require("@dxos/context");
|
|
967
909
|
var import_debug3 = require("@dxos/debug");
|
|
968
910
|
var import_feed_store = require("@dxos/feed-store");
|
|
@@ -1003,7 +945,7 @@ var createMessageSelector = (timeframeClock) => {
|
|
|
1003
945
|
};
|
|
1004
946
|
|
|
1005
947
|
// packages/core/echo/echo-pipeline/src/pipeline/timeframe-clock.ts
|
|
1006
|
-
var
|
|
948
|
+
var import_async3 = require("@dxos/async");
|
|
1007
949
|
var import_debug2 = require("@dxos/debug");
|
|
1008
950
|
var import_log6 = require("@dxos/log");
|
|
1009
951
|
var import_timeframe = require("@dxos/timeframe");
|
|
@@ -1029,7 +971,7 @@ var startAfter = (timeframe) => timeframe.frames().map(([feedKey, index]) => ({
|
|
|
1029
971
|
var TimeframeClock = class {
|
|
1030
972
|
constructor(_timeframe = new import_timeframe.Timeframe()) {
|
|
1031
973
|
this._timeframe = _timeframe;
|
|
1032
|
-
this.update = new
|
|
974
|
+
this.update = new import_async3.Event();
|
|
1033
975
|
this._pendingTimeframe = _timeframe;
|
|
1034
976
|
}
|
|
1035
977
|
/**
|
|
@@ -1113,7 +1055,7 @@ var PipelineState = class {
|
|
|
1113
1055
|
this._timeframeClock = _timeframeClock;
|
|
1114
1056
|
this._ctx = new import_context4.Context();
|
|
1115
1057
|
this.timeframeUpdate = this._timeframeClock.update;
|
|
1116
|
-
this.stalled = new
|
|
1058
|
+
this.stalled = new import_async4.Event();
|
|
1117
1059
|
this._startTimeframe = new import_timeframe2.Timeframe();
|
|
1118
1060
|
this._reachedTarget = false;
|
|
1119
1061
|
}
|
|
@@ -1187,7 +1129,7 @@ var PipelineState = class {
|
|
|
1187
1129
|
done = true;
|
|
1188
1130
|
this._reachedTarget = true;
|
|
1189
1131
|
}),
|
|
1190
|
-
(0,
|
|
1132
|
+
(0, import_async4.sleepWithContext)(this._ctx, timeout).then(() => {
|
|
1191
1133
|
if (done) {
|
|
1192
1134
|
return;
|
|
1193
1135
|
}
|
|
@@ -1216,8 +1158,8 @@ var Pipeline = class {
|
|
|
1216
1158
|
// External state accessor.
|
|
1217
1159
|
this._state = new PipelineState(this._feeds, this._timeframeClock);
|
|
1218
1160
|
// Waits for the message consumer to process the message and yield control back to the pipeline.
|
|
1219
|
-
this._processingTrigger = new
|
|
1220
|
-
this._pauseTrigger = new
|
|
1161
|
+
this._processingTrigger = new import_async4.Trigger().wake();
|
|
1162
|
+
this._pauseTrigger = new import_async4.Trigger().wake();
|
|
1221
1163
|
// Pending downloads.
|
|
1222
1164
|
this._downloads = new import_util4.ComplexMap((value) => import_keys4.PublicKey.hash(value.key));
|
|
1223
1165
|
this._isStopping = false;
|
|
@@ -1495,19 +1437,19 @@ var Pipeline = class {
|
|
|
1495
1437
|
}
|
|
1496
1438
|
};
|
|
1497
1439
|
_ts_decorate3([
|
|
1498
|
-
|
|
1440
|
+
import_async4.synchronized
|
|
1499
1441
|
], Pipeline.prototype, "start", null);
|
|
1500
1442
|
_ts_decorate3([
|
|
1501
|
-
|
|
1443
|
+
import_async4.synchronized
|
|
1502
1444
|
], Pipeline.prototype, "stop", null);
|
|
1503
1445
|
_ts_decorate3([
|
|
1504
|
-
|
|
1446
|
+
import_async4.synchronized
|
|
1505
1447
|
], Pipeline.prototype, "setCursor", null);
|
|
1506
1448
|
_ts_decorate3([
|
|
1507
|
-
|
|
1449
|
+
import_async4.synchronized
|
|
1508
1450
|
], Pipeline.prototype, "pause", null);
|
|
1509
1451
|
_ts_decorate3([
|
|
1510
|
-
|
|
1452
|
+
import_async4.synchronized
|
|
1511
1453
|
], Pipeline.prototype, "unpause", null);
|
|
1512
1454
|
|
|
1513
1455
|
// packages/core/echo/echo-pipeline/src/space/control-pipeline.ts
|
|
@@ -1532,8 +1474,8 @@ var ControlPipeline = class ControlPipeline2 {
|
|
|
1532
1474
|
this.onFeedAdmitted = new import_util5.Callback();
|
|
1533
1475
|
this._usage = new import_tracing.TimeUsageCounter();
|
|
1534
1476
|
this._mutations = new import_tracing.TimeSeriesCounter();
|
|
1535
|
-
this._snapshotTask = new
|
|
1536
|
-
await (0,
|
|
1477
|
+
this._snapshotTask = new import_async5.DeferredTask(this._ctx, async () => {
|
|
1478
|
+
await (0, import_async5.sleepWithContext)(this._ctx, CONTROL_PIPELINE_SNAPSHOT_DELAY);
|
|
1537
1479
|
await this._saveSnapshot();
|
|
1538
1480
|
});
|
|
1539
1481
|
this._spaceKey = spaceKey;
|
|
@@ -1756,11 +1698,11 @@ _ts_decorate4([
|
|
|
1756
1698
|
], ControlPipeline.prototype, "_processMessage", null);
|
|
1757
1699
|
ControlPipeline = _ts_decorate4([
|
|
1758
1700
|
import_tracing.trace.resource(),
|
|
1759
|
-
(0,
|
|
1701
|
+
(0, import_async5.trackLeaks)("start", "stop")
|
|
1760
1702
|
], ControlPipeline);
|
|
1761
1703
|
|
|
1762
1704
|
// packages/core/echo/echo-pipeline/src/space/data-pipeline.ts
|
|
1763
|
-
var
|
|
1705
|
+
var import_async6 = require("@dxos/async");
|
|
1764
1706
|
var import_context6 = require("@dxos/context");
|
|
1765
1707
|
var import_credentials3 = require("@dxos/credentials");
|
|
1766
1708
|
var import_echo_db3 = require("@dxos/echo-db");
|
|
@@ -1799,7 +1741,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1799
1741
|
this._mutations = new import_tracing2.TimeSeriesCounter();
|
|
1800
1742
|
this.currentEpoch = void 0;
|
|
1801
1743
|
this.appliedEpoch = void 0;
|
|
1802
|
-
this.onNewEpoch = new
|
|
1744
|
+
this.onNewEpoch = new import_async6.Event();
|
|
1803
1745
|
}
|
|
1804
1746
|
get isOpen() {
|
|
1805
1747
|
return this._isOpen;
|
|
@@ -1862,7 +1804,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1862
1804
|
this.databaseHost = new DatabaseHost(feedWriter, () => this._flush());
|
|
1863
1805
|
this.itemManager = new import_echo_db3.ItemManager(this._params.modelFactory);
|
|
1864
1806
|
await this.databaseHost.open(this.itemManager, this._params.modelFactory);
|
|
1865
|
-
(0,
|
|
1807
|
+
(0, import_async6.scheduleTask)(this._ctx, async () => {
|
|
1866
1808
|
await this._consumePipeline();
|
|
1867
1809
|
});
|
|
1868
1810
|
this._isOpen = true;
|
|
@@ -1981,7 +1923,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
1981
1923
|
span.end();
|
|
1982
1924
|
if (++messageCounter > 1e3) {
|
|
1983
1925
|
messageCounter = 0;
|
|
1984
|
-
await (0,
|
|
1926
|
+
await (0, import_async6.sleep)(1);
|
|
1985
1927
|
}
|
|
1986
1928
|
}
|
|
1987
1929
|
}
|
|
@@ -2061,7 +2003,7 @@ var DataPipeline = class DataPipeline2 {
|
|
|
2061
2003
|
}
|
|
2062
2004
|
});
|
|
2063
2005
|
this._epochCtx = ctx;
|
|
2064
|
-
(0,
|
|
2006
|
+
(0, import_async6.scheduleTask)(ctx, async () => {
|
|
2065
2007
|
if (!this._isOpen) {
|
|
2066
2008
|
return;
|
|
2067
2009
|
}
|
|
@@ -2182,19 +2124,19 @@ _ts_decorate5([
|
|
|
2182
2124
|
import_tracing2.trace.metricsCounter()
|
|
2183
2125
|
], DataPipeline.prototype, "_mutations", void 0);
|
|
2184
2126
|
_ts_decorate5([
|
|
2185
|
-
|
|
2127
|
+
import_async6.synchronized
|
|
2186
2128
|
], DataPipeline.prototype, "open", null);
|
|
2187
2129
|
_ts_decorate5([
|
|
2188
|
-
|
|
2130
|
+
import_async6.synchronized
|
|
2189
2131
|
], DataPipeline.prototype, "close", null);
|
|
2190
2132
|
_ts_decorate5([
|
|
2191
|
-
|
|
2133
|
+
import_async6.synchronized
|
|
2192
2134
|
], DataPipeline.prototype, "_processEpoch", null);
|
|
2193
2135
|
_ts_decorate5([
|
|
2194
|
-
|
|
2136
|
+
import_async6.synchronized
|
|
2195
2137
|
], DataPipeline.prototype, "createEpoch", null);
|
|
2196
2138
|
DataPipeline = _ts_decorate5([
|
|
2197
|
-
(0,
|
|
2139
|
+
(0, import_async6.trackLeaks)("open", "close"),
|
|
2198
2140
|
import_tracing2.trace.resource()
|
|
2199
2141
|
], DataPipeline);
|
|
2200
2142
|
|
|
@@ -2212,9 +2154,9 @@ function _ts_decorate6(decorators, target, key, desc) {
|
|
|
2212
2154
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/core/echo/echo-pipeline/src/space/space.ts";
|
|
2213
2155
|
var Space = class Space2 {
|
|
2214
2156
|
constructor(params) {
|
|
2215
|
-
this._addFeedLock = new
|
|
2157
|
+
this._addFeedLock = new import_async7.Lock();
|
|
2216
2158
|
this.onCredentialProcessed = new import_util7.Callback();
|
|
2217
|
-
this.stateUpdate = new
|
|
2159
|
+
this.stateUpdate = new import_async7.Event();
|
|
2218
2160
|
this._isOpen = false;
|
|
2219
2161
|
(0, import_invariant9.invariant)(params.spaceKey && params.feedProvider, void 0, {
|
|
2220
2162
|
F: __dxlog_file11,
|
|
@@ -2433,22 +2375,22 @@ _ts_decorate6([
|
|
|
2433
2375
|
import_tracing3.trace.info()
|
|
2434
2376
|
], Space.prototype, "key", null);
|
|
2435
2377
|
_ts_decorate6([
|
|
2436
|
-
|
|
2378
|
+
import_async7.synchronized,
|
|
2437
2379
|
import_tracing3.trace.span()
|
|
2438
2380
|
], Space.prototype, "open", null);
|
|
2439
2381
|
_ts_decorate6([
|
|
2440
|
-
|
|
2382
|
+
import_async7.synchronized
|
|
2441
2383
|
], Space.prototype, "close", null);
|
|
2442
2384
|
_ts_decorate6([
|
|
2443
|
-
|
|
2385
|
+
import_async7.synchronized
|
|
2444
2386
|
], Space.prototype, "initializeDataPipeline", null);
|
|
2445
2387
|
Space = _ts_decorate6([
|
|
2446
|
-
(0,
|
|
2388
|
+
(0, import_async7.trackLeaks)("open", "close"),
|
|
2447
2389
|
import_tracing3.trace.resource()
|
|
2448
2390
|
], Space);
|
|
2449
2391
|
|
|
2450
2392
|
// packages/core/echo/echo-pipeline/src/space/space-manager.ts
|
|
2451
|
-
var
|
|
2393
|
+
var import_async8 = require("@dxos/async");
|
|
2452
2394
|
var import_debug4 = require("@dxos/debug");
|
|
2453
2395
|
var import_keys7 = require("@dxos/keys");
|
|
2454
2396
|
var import_log12 = require("@dxos/log");
|
|
@@ -2746,13 +2688,13 @@ var SpaceManager = class SpaceManager2 {
|
|
|
2746
2688
|
}
|
|
2747
2689
|
};
|
|
2748
2690
|
_ts_decorate8([
|
|
2749
|
-
|
|
2691
|
+
import_async8.synchronized
|
|
2750
2692
|
], SpaceManager.prototype, "open", null);
|
|
2751
2693
|
_ts_decorate8([
|
|
2752
|
-
|
|
2694
|
+
import_async8.synchronized
|
|
2753
2695
|
], SpaceManager.prototype, "close", null);
|
|
2754
2696
|
SpaceManager = _ts_decorate8([
|
|
2755
|
-
(0,
|
|
2697
|
+
(0, import_async8.trackLeaks)("open", "close")
|
|
2756
2698
|
], SpaceManager);
|
|
2757
2699
|
|
|
2758
2700
|
// packages/core/echo/echo-pipeline/src/testing/test-agent-builder.ts
|
|
@@ -2929,7 +2871,7 @@ var TestAgent = class {
|
|
|
2929
2871
|
};
|
|
2930
2872
|
|
|
2931
2873
|
// packages/core/echo/echo-pipeline/src/testing/util.ts
|
|
2932
|
-
var
|
|
2874
|
+
var import_async9 = require("@dxos/async");
|
|
2933
2875
|
var import_document_model2 = require("@dxos/document-model");
|
|
2934
2876
|
var import_echo_db4 = require("@dxos/echo-db");
|
|
2935
2877
|
var import_testing2 = require("@dxos/feed-store/testing");
|
|
@@ -2991,11 +2933,11 @@ var testLocalDatabase = async (create, check = create) => {
|
|
|
2991
2933
|
]
|
|
2992
2934
|
}
|
|
2993
2935
|
});
|
|
2994
|
-
await (0,
|
|
2936
|
+
await (0, import_async9.asyncTimeout)(check.databaseHost._itemDemuxer.mutation.waitForCondition(() => check.itemManager.entities.has(objectId)), 2e3);
|
|
2995
2937
|
};
|
|
2996
2938
|
|
|
2997
2939
|
// packages/core/echo/echo-pipeline/src/testing/database-test-rig.ts
|
|
2998
|
-
var
|
|
2940
|
+
var import_async10 = require("@dxos/async");
|
|
2999
2941
|
var import_document_model3 = require("@dxos/document-model");
|
|
3000
2942
|
var import_echo_db5 = require("@dxos/echo-db");
|
|
3001
2943
|
var import_invariant10 = require("@dxos/invariant");
|
|
@@ -3028,7 +2970,7 @@ var DatabaseTestPeer = class {
|
|
|
3028
2970
|
this.snapshots = /* @__PURE__ */ new Map();
|
|
3029
2971
|
this.confirmed = -1;
|
|
3030
2972
|
this.timeframe = new import_timeframe6.Timeframe();
|
|
3031
|
-
this._onConfirm = new
|
|
2973
|
+
this._onConfirm = new import_async10.Event();
|
|
3032
2974
|
this._writes = /* @__PURE__ */ new Set();
|
|
3033
2975
|
}
|
|
3034
2976
|
async open() {
|
|
@@ -3049,7 +2991,7 @@ var DatabaseTestPeer = class {
|
|
|
3049
2991
|
options: {
|
|
3050
2992
|
afterWrite
|
|
3051
2993
|
},
|
|
3052
|
-
trigger: new
|
|
2994
|
+
trigger: new import_async10.Trigger()
|
|
3053
2995
|
};
|
|
3054
2996
|
this._writes.add(request);
|
|
3055
2997
|
await request.trigger.wait();
|
|
@@ -3063,9 +3005,7 @@ var DatabaseTestPeer = class {
|
|
|
3063
3005
|
}
|
|
3064
3006
|
this.items = new import_echo_db5.ItemManager(this.modelFactory);
|
|
3065
3007
|
this.proxy = new import_echo_db5.DatabaseProxy({
|
|
3066
|
-
service: this.host.createDataServiceHost(
|
|
3067
|
-
deferEvents: false
|
|
3068
|
-
}),
|
|
3008
|
+
service: this.host.createDataServiceHost(),
|
|
3069
3009
|
itemManager: this.items,
|
|
3070
3010
|
spaceKey: this.spaceKey
|
|
3071
3011
|
});
|