@dxos/echo-pipeline 0.1.53-main.52ca4e9 → 0.1.53-main.5bcfb84

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.
Files changed (34) hide show
  1. package/dist/lib/browser/{chunk-SCMKAWNW.mjs → chunk-RFRZMQ5T.mjs} +95 -63
  2. package/dist/lib/browser/chunk-RFRZMQ5T.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +1 -1
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/testing/index.mjs +2 -2
  6. package/dist/lib/browser/testing/index.mjs.map +2 -2
  7. package/dist/lib/node/index.cjs +96 -64
  8. package/dist/lib/node/index.cjs.map +3 -3
  9. package/dist/lib/node/meta.json +1 -1
  10. package/dist/lib/node/testing/index.cjs +102 -70
  11. package/dist/lib/node/testing/index.cjs.map +3 -3
  12. package/dist/types/src/dbhost/data-service-host.d.ts +3 -0
  13. package/dist/types/src/dbhost/data-service-host.d.ts.map +1 -1
  14. package/dist/types/src/dbhost/data-service.d.ts +2 -2
  15. package/dist/types/src/dbhost/data-service.d.ts.map +1 -1
  16. package/dist/types/src/metadata/metadata-store.d.ts +4 -0
  17. package/dist/types/src/metadata/metadata-store.d.ts.map +1 -1
  18. package/dist/types/src/pipeline/pipeline.d.ts +0 -1
  19. package/dist/types/src/pipeline/pipeline.d.ts.map +1 -1
  20. package/dist/types/src/space/data-pipeline.d.ts +3 -3
  21. package/dist/types/src/space/data-pipeline.d.ts.map +1 -1
  22. package/dist/types/src/space/space.d.ts +0 -1
  23. package/dist/types/src/space/space.d.ts.map +1 -1
  24. package/package.json +30 -30
  25. package/src/dbhost/data-service-host.ts +14 -1
  26. package/src/dbhost/data-service.ts +6 -2
  27. package/src/metadata/metadata-store.ts +15 -2
  28. package/src/pipeline/pipeline.ts +13 -1
  29. package/src/space/data-pipeline.ts +25 -19
  30. package/src/space/space.test.ts +46 -5
  31. package/src/space/space.ts +3 -12
  32. package/src/testing/util.ts +1 -1
  33. package/src/tests/database.test.ts +1 -1
  34. package/dist/lib/browser/chunk-SCMKAWNW.mjs.map +0 -7
@@ -7,6 +7,7 @@ import { synchronized, Event } from "@dxos/async";
7
7
  import { DataCorruptionError } from "@dxos/errors";
8
8
  import { log } from "@dxos/log";
9
9
  import { STORAGE_VERSION, schema } from "@dxos/protocols";
10
+ import { SpaceState } from "@dxos/protocols/proto/dxos/client/services";
10
11
  import { arrayToBuffer } from "@dxos/util";
11
12
  function _ts_decorate(decorators, target, key, desc) {
12
13
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -25,6 +26,7 @@ var emptyEchoMetadata = () => ({
25
26
  created: new Date(),
26
27
  updated: new Date()
27
28
  });
29
+ var EchoMetadata = schema.getCodecForType("dxos.echo.metadata.EchoMetadata");
28
30
  var MetadataStore = class {
29
31
  // prettier-ignore
30
32
  constructor(_directory) {
@@ -51,6 +53,7 @@ var MetadataStore = class {
51
53
  * Loads metadata from persistent storage.
52
54
  */
53
55
  async load() {
56
+ var _a;
54
57
  const file = this._directory.getOrCreateFile("EchoMetadata");
55
58
  try {
56
59
  const { size: fileLength } = await file.stat();
@@ -64,7 +67,7 @@ var MetadataStore = class {
64
67
  checksum
65
68
  }, {
66
69
  F: __dxlog_file,
67
- L: 69,
70
+ L: 72,
68
71
  S: this,
69
72
  C: (f, a) => f(...a)
70
73
  });
@@ -76,13 +79,17 @@ var MetadataStore = class {
76
79
  if (calculatedChecksum !== checksum) {
77
80
  throw new DataCorruptionError("Metadata checksum is invalid.");
78
81
  }
79
- this._metadata = schema.getCodecForType("dxos.echo.metadata.EchoMetadata").decode(data);
82
+ this._metadata = EchoMetadata.decode(data);
83
+ (_a = this._metadata.spaces) == null ? void 0 : _a.forEach((space) => {
84
+ var _a2;
85
+ (_a2 = space.state) != null ? _a2 : space.state = SpaceState.ACTIVE;
86
+ });
80
87
  } catch (err) {
81
88
  log.error("failed to load metadata", {
82
89
  err
83
90
  }, {
84
91
  F: __dxlog_file,
85
- L: 84,
92
+ L: 92,
86
93
  S: this,
87
94
  C: (f, a) => f(...a)
88
95
  });
@@ -102,7 +109,7 @@ var MetadataStore = class {
102
109
  this.update.emit(data);
103
110
  const file = this._directory.getOrCreateFile("EchoMetadata");
104
111
  try {
105
- const encoded = arrayToBuffer(schema.getCodecForType("dxos.echo.metadata.EchoMetadata").encode(data));
112
+ const encoded = arrayToBuffer(EchoMetadata.encode(data));
106
113
  const checksum = CRC32.buf(encoded);
107
114
  const result = Buffer.alloc(8 + encoded.length);
108
115
  result.writeInt32LE(encoded.length, 0);
@@ -114,7 +121,7 @@ var MetadataStore = class {
114
121
  checksum
115
122
  }, {
116
123
  F: __dxlog_file,
117
- L: 116,
124
+ L: 124,
118
125
  S: this,
119
126
  C: (f, a) => f(...a)
120
127
  });
@@ -137,7 +144,7 @@ var MetadataStore = class {
137
144
  async clear() {
138
145
  log("clearing all metadata", void 0, {
139
146
  F: __dxlog_file,
140
- L: 137,
147
+ L: 145,
141
148
  S: this,
142
149
  C: (f, a) => f(...a)
143
150
  });
@@ -176,6 +183,10 @@ var MetadataStore = class {
176
183
  space.dataFeedKey = dataFeedKey;
177
184
  await this._save();
178
185
  }
186
+ async setSpaceState(spaceKey, state) {
187
+ this._getSpace(spaceKey).state = state;
188
+ await this._save();
189
+ }
179
190
  };
180
191
  _ts_decorate([
181
192
  synchronized
@@ -349,6 +360,7 @@ var PipelineState = class {
349
360
  constructor(_feeds, _timeframeClock) {
350
361
  this._feeds = _feeds;
351
362
  this._timeframeClock = _timeframeClock;
363
+ this._ctx = new Context();
352
364
  this.timeframeUpdate = this._timeframeClock.update;
353
365
  this.stalled = new Event3();
354
366
  this._startTimeframe = new Timeframe2();
@@ -400,7 +412,7 @@ var PipelineState = class {
400
412
  target: this.targetTimeframe
401
413
  }, {
402
414
  F: __dxlog_file4,
403
- L: 118,
415
+ L: 126,
404
416
  S: this,
405
417
  C: (f, a) => f(...a)
406
418
  });
@@ -416,6 +428,7 @@ var PipelineState = class {
416
428
  if (timeout) {
417
429
  return Promise.race([
418
430
  rejectOnDispose(ctx),
431
+ rejectOnDispose(this._ctx),
419
432
  this._reachedTargetPromise.then(() => {
420
433
  done = true;
421
434
  }),
@@ -430,7 +443,7 @@ var PipelineState = class {
430
443
  dependencies: Timeframe2.dependencies(this.targetTimeframe, this.timeframe)
431
444
  }, {
432
445
  F: __dxlog_file4,
433
- L: 144,
446
+ L: 153,
434
447
  S: this,
435
448
  C: (f, a) => f(...a)
436
449
  });
@@ -488,7 +501,7 @@ var Pipeline = class {
488
501
  async start() {
489
502
  log4("starting...", {}, {
490
503
  F: __dxlog_file4,
491
- L: 264,
504
+ L: 273,
492
505
  S: this,
493
506
  C: (f, a) => f(...a)
494
507
  });
@@ -496,7 +509,7 @@ var Pipeline = class {
496
509
  await this._feedSetIterator.open();
497
510
  log4("started", void 0, {
498
511
  F: __dxlog_file4,
499
- L: 267,
512
+ L: 276,
500
513
  S: this,
501
514
  C: (f, a) => f(...a)
502
515
  });
@@ -506,16 +519,19 @@ var Pipeline = class {
506
519
  var _a;
507
520
  log4("stopping...", {}, {
508
521
  F: __dxlog_file4,
509
- L: 273,
522
+ L: 282,
510
523
  S: this,
511
524
  C: (f, a) => f(...a)
512
525
  });
513
526
  this._isStopping = true;
514
527
  await ((_a = this._feedSetIterator) == null ? void 0 : _a.close());
515
528
  await this._processingTrigger.wait();
529
+ await this._state._ctx.dispose();
530
+ this._state._ctx = new Context();
531
+ this._state._reachedTargetPromise = void 0;
516
532
  log4("stopped", void 0, {
517
533
  F: __dxlog_file4,
518
- L: 277,
534
+ L: 289,
519
535
  S: this,
520
536
  C: (f, a) => f(...a)
521
537
  });
@@ -592,7 +608,7 @@ var Pipeline = class {
592
608
  feed.undownload({
593
609
  callback: () => log4("Undownloaded", void 0, {
594
610
  F: __dxlog_file4,
595
- L: 371,
611
+ L: 383,
596
612
  S: this,
597
613
  C: (f, a) => f(...a)
598
614
  })
@@ -605,7 +621,7 @@ var Pipeline = class {
605
621
  err
606
622
  }, {
607
623
  F: __dxlog_file4,
608
- L: 374,
624
+ L: 386,
609
625
  S: this,
610
626
  C: (f, a) => f(...a)
611
627
  });
@@ -619,7 +635,7 @@ var Pipeline = class {
619
635
  this._feedSetIterator.stalled.on((iterator) => {
620
636
  log4.warn(`Stalled after ${iterator.options.stallTimeout}ms with ${iterator.size} feeds.`, void 0, {
621
637
  F: __dxlog_file4,
622
- L: 384,
638
+ L: 396,
623
639
  S: this,
624
640
  C: (f, a) => f(...a)
625
641
  });
@@ -736,6 +752,7 @@ var AuthExtension = class extends RpcExtension {
736
752
  // packages/core/echo/echo-pipeline/src/dbhost/data-service-host.ts
737
753
  import invariant6 from "tiny-invariant";
738
754
  import { Stream } from "@dxos/codec-protobuf";
755
+ import { Context as Context3 } from "@dxos/context";
739
756
  import { tagMutationsInBatch, setMetadataOnObject } from "@dxos/echo-db";
740
757
  import { log as log6 } from "@dxos/log";
741
758
  import { ComplexMap as ComplexMap2 } from "@dxos/util";
@@ -745,13 +762,20 @@ var DataServiceHost = class {
745
762
  this._itemManager = _itemManager;
746
763
  this._itemDemuxer = _itemDemuxer;
747
764
  this._writeStream = _writeStream;
765
+ this._ctx = new Context3();
748
766
  this._clientTagMap = new ComplexMap2(([feedKey, seq]) => `${feedKey.toHex()}:${seq}`);
749
767
  }
768
+ async open() {
769
+ }
770
+ async close() {
771
+ await this._ctx.dispose();
772
+ }
750
773
  /**
751
774
  * Real-time subscription to data objects in a space.
752
775
  */
753
776
  subscribe() {
754
- return new Stream(({ next, ctx }) => {
777
+ return new Stream(({ next, close, ctx }) => {
778
+ ctx.onDispose(this._ctx.onDispose(close));
755
779
  const objects = Array.from(this._itemManager.entities.values()).map((entity) => entity.createSnapshot());
756
780
  next({
757
781
  batch: {
@@ -767,7 +791,7 @@ var DataServiceHost = class {
767
791
  meta
768
792
  }, {
769
793
  F: __dxlog_file6,
770
- L: 51,
794
+ L: 63,
771
795
  S: this,
772
796
  C: (f, a) => f(...a)
773
797
  });
@@ -794,13 +818,14 @@ var DataServiceHost = class {
794
818
  }
795
819
  async write(request) {
796
820
  var _a, _b;
821
+ invariant6(!this._ctx.disposed, "Cannot write to closed DataServiceHost");
797
822
  invariant6(this._writeStream, "Cannot write mutations in readonly mode");
798
823
  log6("write", {
799
824
  clientTag: request.clientTag,
800
825
  objectCount: (_b = (_a = request.batch.objects) == null ? void 0 : _a.length) != null ? _b : 0
801
826
  }, {
802
827
  F: __dxlog_file6,
803
- L: 79,
828
+ L: 92,
804
829
  S: this,
805
830
  C: (f, a) => f(...a)
806
831
  });
@@ -814,7 +839,7 @@ var DataServiceHost = class {
814
839
  seq: receipt2.seq
815
840
  }, {
816
841
  F: __dxlog_file6,
817
- L: 88,
842
+ L: 101,
818
843
  S: this,
819
844
  C: (f, a) => f(...a)
820
845
  });
@@ -992,7 +1017,7 @@ var DataServiceSubscriptions = class {
992
1017
  clear() {
993
1018
  this._spaces.clear();
994
1019
  }
995
- registerSpace(spaceKey, host) {
1020
+ async registerSpace(spaceKey, host) {
996
1021
  log7("Registering space", {
997
1022
  spaceKey
998
1023
  }, {
@@ -1001,17 +1026,21 @@ var DataServiceSubscriptions = class {
1001
1026
  S: this,
1002
1027
  C: (f, a) => f(...a)
1003
1028
  });
1029
+ invariant7(!this._spaces.has(spaceKey));
1030
+ await host.open();
1004
1031
  this._spaces.set(spaceKey, host);
1005
1032
  }
1006
- unregisterSpace(spaceKey) {
1033
+ async unregisterSpace(spaceKey) {
1007
1034
  log7("Unregistering space", {
1008
1035
  spaceKey
1009
1036
  }, {
1010
1037
  F: __dxlog_file7,
1011
- L: 36,
1038
+ L: 38,
1012
1039
  S: this,
1013
1040
  C: (f, a) => f(...a)
1014
1041
  });
1042
+ const host = this._spaces.get(spaceKey);
1043
+ await (host == null ? void 0 : host.close());
1015
1044
  this._spaces.delete(spaceKey);
1016
1045
  }
1017
1046
  getDataService(spaceKey) {
@@ -1040,7 +1069,7 @@ var DataServiceImpl = class {
1040
1069
  // packages/core/echo/echo-pipeline/src/space/data-pipeline.ts
1041
1070
  import invariant8 from "tiny-invariant";
1042
1071
  import { Event as Event4, scheduleTask as scheduleTask2, synchronized as synchronized3, trackLeaks as trackLeaks2 } from "@dxos/async";
1043
- import { Context as Context3 } from "@dxos/context";
1072
+ import { Context as Context4 } from "@dxos/context";
1044
1073
  import { checkCredentialType } from "@dxos/credentials";
1045
1074
  import { getStateMachineFromItem, ItemManager } from "@dxos/echo-db";
1046
1075
  import { CancelledError } from "@dxos/errors";
@@ -1063,11 +1092,15 @@ var TIMEFRAME_SAVE_DEBOUNCE_INTERVAL = 500;
1063
1092
  var DataPipeline = class DataPipeline2 {
1064
1093
  constructor(_params) {
1065
1094
  this._params = _params;
1066
- this._ctx = new Context3();
1095
+ this._ctx = new Context4();
1096
+ this._pipeline = void 0;
1097
+ this._targetTimeframe = void 0;
1067
1098
  this._lastAutomaticSnapshotTimeframe = new Timeframe3();
1068
1099
  this._isOpen = false;
1069
1100
  this._lastTimeframeSaveTime = 0;
1070
1101
  this._lastSnapshotSaveTime = 0;
1102
+ this.currentEpoch = void 0;
1103
+ this.appliedEpoch = void 0;
1071
1104
  this._lastProcessedEpoch = -1;
1072
1105
  this.onNewEpoch = new Event4();
1073
1106
  }
@@ -1086,18 +1119,14 @@ var DataPipeline = class DataPipeline2 {
1086
1119
  this._targetTimeframe = timeframe;
1087
1120
  (_a = this._pipeline) == null ? void 0 : _a.state.setTargetTimeframe(timeframe);
1088
1121
  }
1089
- createCredentialProcessor() {
1090
- return {
1091
- process: async (credential) => {
1092
- if (!checkCredentialType(credential, "dxos.halo.credentials.Epoch")) {
1093
- return;
1094
- }
1095
- this.currentEpoch = credential;
1096
- if (this._isOpen) {
1097
- await this._processEpochInSeparateTask(credential);
1098
- }
1099
- }
1100
- };
1122
+ async processCredential(credential) {
1123
+ if (!checkCredentialType(credential, "dxos.halo.credentials.Epoch")) {
1124
+ return;
1125
+ }
1126
+ this.currentEpoch = credential;
1127
+ if (this._isOpen) {
1128
+ await this._processEpochInSeparateTask(credential);
1129
+ }
1101
1130
  }
1102
1131
  async open() {
1103
1132
  if (this._isOpen) {
@@ -1134,7 +1163,7 @@ var DataPipeline = class DataPipeline2 {
1134
1163
  }
1135
1164
  log8("close", void 0, {
1136
1165
  F: __dxlog_file8,
1137
- L: 174,
1166
+ L: 171,
1138
1167
  S: this,
1139
1168
  C: (f, a) => f(...a)
1140
1169
  });
@@ -1149,13 +1178,21 @@ var DataPipeline = class DataPipeline2 {
1149
1178
  } catch (err) {
1150
1179
  log8.catch(err, void 0, {
1151
1180
  F: __dxlog_file8,
1152
- L: 187,
1181
+ L: 184,
1153
1182
  S: this,
1154
1183
  C: (f, a) => f(...a)
1155
1184
  });
1156
1185
  }
1157
1186
  await ((_b = this.databaseHost) == null ? void 0 : _b.close());
1158
1187
  await ((_c = this.itemManager) == null ? void 0 : _c.destroy());
1188
+ this._ctx = new Context4();
1189
+ this._pipeline = void 0;
1190
+ this._targetTimeframe = void 0;
1191
+ this._lastAutomaticSnapshotTimeframe = new Timeframe3();
1192
+ this.currentEpoch = void 0;
1193
+ this.appliedEpoch = void 0;
1194
+ this._lastProcessedEpoch = -1;
1195
+ this._epochCtx = void 0;
1159
1196
  }
1160
1197
  async _consumePipeline() {
1161
1198
  if (this.currentEpoch) {
@@ -1171,7 +1208,7 @@ var DataPipeline = class DataPipeline2 {
1171
1208
  seq
1172
1209
  }, {
1173
1210
  F: __dxlog_file8,
1174
- L: 204,
1211
+ L: 210,
1175
1212
  S: this,
1176
1213
  C: (f, a) => f(...a)
1177
1214
  });
@@ -1183,7 +1220,7 @@ var DataPipeline = class DataPipeline2 {
1183
1220
  feedKey
1184
1221
  }, {
1185
1222
  F: __dxlog_file8,
1186
- L: 210,
1223
+ L: 216,
1187
1224
  S: this,
1188
1225
  C: (f, a) => f(...a)
1189
1226
  });
@@ -1204,7 +1241,7 @@ var DataPipeline = class DataPipeline2 {
1204
1241
  spaceKey: this._params.spaceKey.toHex()
1205
1242
  }, {
1206
1243
  F: __dxlog_file8,
1207
- L: 224,
1244
+ L: 230,
1208
1245
  S: this,
1209
1246
  C: (f, a) => f(...a)
1210
1247
  });
@@ -1213,7 +1250,7 @@ var DataPipeline = class DataPipeline2 {
1213
1250
  } catch (err) {
1214
1251
  log8.catch(err, void 0, {
1215
1252
  F: __dxlog_file8,
1216
- L: 234,
1253
+ L: 240,
1217
1254
  S: this,
1218
1255
  C: (f, a) => f(...a)
1219
1256
  });
@@ -1248,7 +1285,7 @@ var DataPipeline = class DataPipeline2 {
1248
1285
  } catch (err) {
1249
1286
  log8.warn("Failed to cache properties", err, {
1250
1287
  F: __dxlog_file8,
1251
- L: 269,
1288
+ L: 275,
1252
1289
  S: this,
1253
1290
  C: (f, a) => f(...a)
1254
1291
  });
@@ -1270,19 +1307,19 @@ var DataPipeline = class DataPipeline2 {
1270
1307
  return;
1271
1308
  }
1272
1309
  await ((_a = this._epochCtx) == null ? void 0 : _a.dispose());
1273
- const ctx = new Context3({
1310
+ const ctx = new Context4({
1274
1311
  onError: (err) => {
1275
1312
  if (err instanceof CancelledError) {
1276
1313
  log8("Epoch processing cancelled.", void 0, {
1277
1314
  F: __dxlog_file8,
1278
- L: 301,
1315
+ L: 307,
1279
1316
  S: this,
1280
1317
  C: (f, a) => f(...a)
1281
1318
  });
1282
1319
  } else {
1283
1320
  log8.catch(err, void 0, {
1284
1321
  F: __dxlog_file8,
1285
- L: 303,
1322
+ L: 309,
1286
1323
  S: this,
1287
1324
  C: (f, a) => f(...a)
1288
1325
  });
@@ -1298,7 +1335,7 @@ var DataPipeline = class DataPipeline2 {
1298
1335
  epoch
1299
1336
  }, {
1300
1337
  F: __dxlog_file8,
1301
- L: 313,
1338
+ L: 319,
1302
1339
  S: this,
1303
1340
  C: (f, a) => f(...a)
1304
1341
  });
@@ -1315,7 +1352,7 @@ var DataPipeline = class DataPipeline2 {
1315
1352
  epoch
1316
1353
  }, {
1317
1354
  F: __dxlog_file8,
1318
- L: 327,
1355
+ L: 333,
1319
1356
  S: this,
1320
1357
  C: (f, a) => f(...a)
1321
1358
  });
@@ -1325,7 +1362,7 @@ var DataPipeline = class DataPipeline2 {
1325
1362
  }
1326
1363
  log8("restarting pipeline for epoch", void 0, {
1327
1364
  F: __dxlog_file8,
1328
- L: 335,
1365
+ L: 341,
1329
1366
  S: this,
1330
1367
  C: (f, a) => f(...a)
1331
1368
  });
@@ -1541,8 +1578,6 @@ var Space = class Space2 {
1541
1578
  this._addFeedLock = new Lock();
1542
1579
  this.onCredentialProcessed = new Callback2();
1543
1580
  this.stateUpdate = new Event5();
1544
- // Processes epoch credentials.
1545
- this._dataPipelineCredentialConsumer = void 0;
1546
1581
  this._isOpen = false;
1547
1582
  invariant9(params.spaceKey && params.feedProvider);
1548
1583
  this._key = params.spaceKey;
@@ -1580,7 +1615,7 @@ var Space = class Space2 {
1580
1615
  credential
1581
1616
  }, {
1582
1617
  F: __dxlog_file10,
1583
- L: 110,
1618
+ L: 107,
1584
1619
  S: this,
1585
1620
  C: (f, a) => f(...a)
1586
1621
  });
@@ -1672,7 +1707,7 @@ var Space = class Space2 {
1672
1707
  async open() {
1673
1708
  log10("opening...", void 0, {
1674
1709
  F: __dxlog_file10,
1675
- L: 212,
1710
+ L: 209,
1676
1711
  S: this,
1677
1712
  C: (f, a) => f(...a)
1678
1713
  });
@@ -1681,38 +1716,35 @@ var Space = class Space2 {
1681
1716
  }
1682
1717
  await this._controlPipeline.start();
1683
1718
  await this.protocol.start();
1684
- this._dataPipelineCredentialConsumer = this._controlPipeline.spaceState.registerProcessor(this._dataPipeline.createCredentialProcessor());
1685
- await this._dataPipelineCredentialConsumer.open();
1719
+ await this._controlPipeline.spaceState.addCredentialProcessor(this._dataPipeline);
1686
1720
  this._isOpen = true;
1687
1721
  log10("opened", void 0, {
1688
1722
  F: __dxlog_file10,
1689
- L: 228,
1723
+ L: 220,
1690
1724
  S: this,
1691
1725
  C: (f, a) => f(...a)
1692
1726
  });
1693
1727
  }
1694
1728
  async close() {
1695
- var _a;
1696
1729
  log10("closing...", {
1697
1730
  key: this._key
1698
1731
  }, {
1699
1732
  F: __dxlog_file10,
1700
- L: 233,
1733
+ L: 225,
1701
1734
  S: this,
1702
1735
  C: (f, a) => f(...a)
1703
1736
  });
1704
1737
  if (!this._isOpen) {
1705
1738
  return;
1706
1739
  }
1707
- await ((_a = this._dataPipelineCredentialConsumer) == null ? void 0 : _a.close());
1708
- this._dataPipelineCredentialConsumer = void 0;
1740
+ await this._controlPipeline.spaceState.removeCredentialProcessor(this._dataPipeline);
1709
1741
  await this._dataPipeline.close();
1710
1742
  await this.protocol.stop();
1711
1743
  await this._controlPipeline.stop();
1712
1744
  this._isOpen = false;
1713
1745
  log10("closed", void 0, {
1714
1746
  F: __dxlog_file10,
1715
- L: 247,
1747
+ L: 238,
1716
1748
  S: this,
1717
1749
  C: (f, a) => f(...a)
1718
1750
  });
@@ -1720,7 +1752,7 @@ var Space = class Space2 {
1720
1752
  async initializeDataPipeline() {
1721
1753
  log10("initializeDataPipeline", void 0, {
1722
1754
  F: __dxlog_file10,
1723
- L: 252,
1755
+ L: 243,
1724
1756
  S: this,
1725
1757
  C: (f, a) => f(...a)
1726
1758
  });
@@ -2068,4 +2100,4 @@ export {
2068
2100
  SpaceProtocolSession,
2069
2101
  SpaceManager
2070
2102
  };
2071
- //# sourceMappingURL=chunk-SCMKAWNW.mjs.map
2103
+ //# sourceMappingURL=chunk-RFRZMQ5T.mjs.map