@dxos/client-services 0.4.3-main.3a01342 → 0.4.3-main.4eed300

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.
@@ -2566,7 +2566,7 @@ var getPlatform = () => {
2566
2566
  };
2567
2567
 
2568
2568
  // packages/sdk/client-services/src/version.ts
2569
- var DXOS_VERSION = "0.4.3-main.3a01342";
2569
+ var DXOS_VERSION = "0.4.3-main.4eed300";
2570
2570
 
2571
2571
  // packages/sdk/client-services/src/packlets/services/diagnostics.ts
2572
2572
  var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/services/diagnostics.ts";
@@ -2708,10 +2708,10 @@ var getSpaceStats = async (space) => {
2708
2708
  };
2709
2709
 
2710
2710
  // packages/sdk/client-services/src/packlets/spaces/data-space.ts
2711
- import { Event as Event5, asyncTimeout, scheduleTask as scheduleTask4, sleep as sleep2, synchronized, trackLeaks } from "@dxos/async";
2711
+ import { Event as Event5, scheduleTask as scheduleTask4, sleep as sleep2, synchronized, trackLeaks } from "@dxos/async";
2712
2712
  import { AUTH_TIMEOUT as AUTH_TIMEOUT2 } from "@dxos/client-protocol";
2713
2713
  import { cancelWithContext as cancelWithContext2, Context as Context7, ContextDisposedError } from "@dxos/context";
2714
- import { timed } from "@dxos/debug";
2714
+ import { timed, warnAfterTimeout } from "@dxos/debug";
2715
2715
  import { createMappedFeedWriter } from "@dxos/echo-pipeline";
2716
2716
  import { failedInvariant } from "@dxos/invariant";
2717
2717
  import { PublicKey as PublicKey8 } from "@dxos/keys";
@@ -3317,7 +3317,12 @@ var DataSpace = class {
3317
3317
  const handle = this._automergeHost.repo.find(rootUrl);
3318
3318
  queueMicrotask(async () => {
3319
3319
  try {
3320
- await asyncTimeout(handle.whenReady(), 5e3);
3320
+ await warnAfterTimeout(5e3, "Automerge root doc load timeout (DataSpace)", async () => {
3321
+ await cancelWithContext2(this._ctx, handle.whenReady());
3322
+ });
3323
+ if (this._ctx.disposed) {
3324
+ return;
3325
+ }
3321
3326
  const doc = handle.docSync() ?? failedInvariant();
3322
3327
  if (!doc.experimental_spaceKey) {
3323
3328
  handle.change((doc2) => {
@@ -3325,13 +3330,16 @@ var DataSpace = class {
3325
3330
  });
3326
3331
  }
3327
3332
  } catch (err) {
3333
+ if (err instanceof ContextDisposedError) {
3334
+ return;
3335
+ }
3328
3336
  log10.warn("error loading automerge root doc", {
3329
3337
  space: this.key,
3330
3338
  rootUrl,
3331
3339
  err
3332
3340
  }, {
3333
3341
  F: __dxlog_file12,
3334
- L: 394,
3342
+ L: 403,
3335
3343
  S: this,
3336
3344
  C: (f, a) => f(...a)
3337
3345
  });
@@ -3421,7 +3429,7 @@ var DataSpace = class {
3421
3429
  state: SpaceState[this._state]
3422
3430
  }, {
3423
3431
  F: __dxlog_file12,
3424
- L: 483,
3432
+ L: 492,
3425
3433
  S: this,
3426
3434
  C: (f, a) => f(...a)
3427
3435
  });
@@ -4416,7 +4424,7 @@ var ServiceRegistry = class {
4416
4424
  };
4417
4425
 
4418
4426
  // packages/sdk/client-services/src/packlets/locks/browser.ts
4419
- import { asyncTimeout as asyncTimeout2, Trigger as Trigger6 } from "@dxos/async";
4427
+ import { asyncTimeout, Trigger as Trigger6 } from "@dxos/async";
4420
4428
  import { RESOURCE_LOCK_TIMEOUT } from "@dxos/client-protocol";
4421
4429
  import { log as log14, logInfo } from "@dxos/log";
4422
4430
  function _ts_decorate7(decorators, target, key, desc) {
@@ -4457,7 +4465,7 @@ var Lock = class {
4457
4465
  S: this,
4458
4466
  C: (f, a) => f(...a)
4459
4467
  });
4460
- await asyncTimeout2(this._requestLock(), RESOURCE_LOCK_TIMEOUT);
4468
+ await asyncTimeout(this._requestLock(), RESOURCE_LOCK_TIMEOUT);
4461
4469
  log14("acquired lock", void 0, {
4462
4470
  F: __dxlog_file16,
4463
4471
  L: 44,
@@ -4815,7 +4823,7 @@ var SystemServiceImpl = class {
4815
4823
  this._onReset = onReset;
4816
4824
  }
4817
4825
  async getConfig() {
4818
- return this._config?.values ?? {};
4826
+ return (await this._config?.())?.values ?? {};
4819
4827
  }
4820
4828
  /**
4821
4829
  * NOTE: Since this is serialized as a JSON object, we allow the option to serialize keys.
@@ -4922,7 +4930,7 @@ var ClientServicesHost = class {
4922
4930
  });
4923
4931
  }
4924
4932
  this._systemService = new SystemServiceImpl({
4925
- config: this._config,
4933
+ config: () => this._config,
4926
4934
  statusUpdate: this._statusUpdate,
4927
4935
  getCurrentStatus: () => this.isOpen ? SystemStatus.ACTIVE : SystemStatus.INACTIVE,
4928
4936
  getDiagnostics: () => {
@@ -5294,4 +5302,4 @@ export {
5294
5302
  createDefaultModelFactory,
5295
5303
  ClientServicesHost
5296
5304
  };
5297
- //# sourceMappingURL=chunk-ZJGCDL3M.mjs.map
5305
+ //# sourceMappingURL=chunk-W7PKKXQW.mjs.map