@dxos/client-services 0.5.9-main.a75fa71 → 0.5.9-main.ac938b0

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.
@@ -359,7 +359,7 @@ import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
359
359
  import { TRACE_PROCESSOR } from "@dxos/tracing";
360
360
 
361
361
  // packages/sdk/client-services/src/version.ts
362
- var DXOS_VERSION = "0.5.9-main.a75fa71";
362
+ var DXOS_VERSION = "0.5.9-main.ac938b0";
363
363
 
364
364
  // packages/sdk/client-services/src/packlets/services/platform.ts
365
365
  import { Platform } from "@dxos/protocols/proto/dxos/client/services";
@@ -4646,7 +4646,7 @@ var DataSpace = class {
4646
4646
  err
4647
4647
  }, {
4648
4648
  F: __dxlog_file18,
4649
- L: 431,
4649
+ L: 433,
4650
4650
  S: this,
4651
4651
  C: (f, a) => f(...a)
4652
4652
  });
@@ -4732,7 +4732,7 @@ var DataSpace = class {
4732
4732
  state: SpaceState2[this._state]
4733
4733
  }, {
4734
4734
  F: __dxlog_file18,
4735
- L: 512,
4735
+ L: 514,
4736
4736
  S: this,
4737
4737
  C: (f, a) => f(...a)
4738
4738
  });
@@ -5746,7 +5746,8 @@ var SpacesServiceImpl = class {
5746
5746
  startDataTimeframe: void 0,
5747
5747
  currentDataTimeframe: void 0,
5748
5748
  targetDataTimeframe: void 0,
5749
- totalDataTimeframe: void 0
5749
+ totalDataTimeframe: void 0,
5750
+ spaceRootUrl: space.databaseRoot?.url
5750
5751
  },
5751
5752
  members: Array.from(space.inner.spaceState.members.values()).map((member) => {
5752
5753
  const peers = space.presence.getPeersOnline().filter(({ identityKey }) => identityKey.equals(member.key));
@@ -6379,14 +6380,15 @@ var exportProfileData = async ({ storage, level }) => {
6379
6380
  return archive;
6380
6381
  };
6381
6382
  var importProfileData = async ({ storage, level }, archive) => {
6382
- const batch = level.batch();
6383
+ let batch = level.batch();
6384
+ let count = 0;
6383
6385
  for (const entry2 of archive.storage) {
6384
6386
  switch (entry2.type) {
6385
6387
  case ProfileArchiveEntryType.FILE: {
6386
6388
  const directory = await storage.createDirectory();
6387
6389
  invariant17(typeof entry2.key === "string", "Invalid key type", {
6388
6390
  F: __dxlog_file23,
6389
- L: 78,
6391
+ L: 79,
6390
6392
  S: void 0,
6391
6393
  A: [
6392
6394
  "typeof entry.key === 'string'",
@@ -6396,7 +6398,7 @@ var importProfileData = async ({ storage, level }, archive) => {
6396
6398
  const file = await directory.getOrCreateFile(entry2.key);
6397
6399
  invariant17(entry2.value instanceof Uint8Array, "Invalid value type", {
6398
6400
  F: __dxlog_file23,
6399
- L: 80,
6401
+ L: 81,
6400
6402
  S: void 0,
6401
6403
  A: [
6402
6404
  "entry.value instanceof Uint8Array",
@@ -6410,7 +6412,7 @@ var importProfileData = async ({ storage, level }, archive) => {
6410
6412
  case ProfileArchiveEntryType.KEY_VALUE: {
6411
6413
  invariant17(entry2.key instanceof Uint8Array, "Invalid key type", {
6412
6414
  F: __dxlog_file23,
6413
- L: 86,
6415
+ L: 87,
6414
6416
  S: void 0,
6415
6417
  A: [
6416
6418
  "entry.key instanceof Uint8Array",
@@ -6419,7 +6421,7 @@ var importProfileData = async ({ storage, level }, archive) => {
6419
6421
  });
6420
6422
  invariant17(entry2.value instanceof Uint8Array, "Invalid value type", {
6421
6423
  F: __dxlog_file23,
6422
- L: 87,
6424
+ L: 88,
6423
6425
  S: void 0,
6424
6426
  A: [
6425
6427
  "entry.value instanceof Uint8Array",
@@ -6435,7 +6437,27 @@ var importProfileData = async ({ storage, level }, archive) => {
6435
6437
  default:
6436
6438
  throw new Error(`Invalid entry type: ${entry2.type}`);
6437
6439
  }
6440
+ if (++count % 1e3 === 0) {
6441
+ await batch.write();
6442
+ batch = level.batch();
6443
+ log20.info("importing", {
6444
+ count,
6445
+ total: archive.storage.length,
6446
+ progress: `${(count / archive.storage.length * 100).toFixed()}%`
6447
+ }, {
6448
+ F: __dxlog_file23,
6449
+ L: 101,
6450
+ S: void 0,
6451
+ C: (f, a) => f(...a)
6452
+ });
6453
+ }
6438
6454
  }
6455
+ log20.info("committing changes..", void 0, {
6456
+ F: __dxlog_file23,
6457
+ L: 109,
6458
+ S: void 0,
6459
+ C: (f, a) => f(...a)
6460
+ });
6439
6461
  await batch.write();
6440
6462
  };
6441
6463
 
@@ -7301,4 +7323,4 @@ export {
7301
7323
  ClientServicesProviderResource,
7302
7324
  DiagnosticsCollector
7303
7325
  };
7304
- //# sourceMappingURL=chunk-DS5JZ6S4.mjs.map
7326
+ //# sourceMappingURL=chunk-I5PIAH6J.mjs.map