@dxos/client-services 0.5.9-main.a50ff17 → 0.5.9-main.af4882d

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.
@@ -7,7 +7,7 @@ import {
7
7
  InvitationsManager,
8
8
  ServiceContext,
9
9
  SpaceInvitationProtocol
10
- } from "../../chunk-K6NPH6LF.mjs";
10
+ } from "../../chunk-6347C7P7.mjs";
11
11
 
12
12
  // packages/sdk/client-services/src/packlets/testing/credential-utils.ts
13
13
  import { createCredential } from "@dxos/credentials";
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_E6AQJD5I_exports = {};
30
- __export(chunk_E6AQJD5I_exports, {
29
+ var chunk_YO26HDFH_exports = {};
30
+ __export(chunk_YO26HDFH_exports, {
31
31
  ClientRpcServer: () => ClientRpcServer,
32
32
  ClientServicesHost: () => ClientServicesHost,
33
33
  ClientServicesProviderResource: () => ClientServicesProviderResource,
@@ -66,7 +66,7 @@ __export(chunk_E6AQJD5I_exports, {
66
66
  subscribeToSpaces: () => subscribeToSpaces,
67
67
  subscribeToSwarmInfo: () => subscribeToSwarmInfo
68
68
  });
69
- module.exports = __toCommonJS(chunk_E6AQJD5I_exports);
69
+ module.exports = __toCommonJS(chunk_YO26HDFH_exports);
70
70
  var import_async = require("@dxos/async");
71
71
  var import_codec_protobuf = require("@dxos/codec-protobuf");
72
72
  var import_feed_store = require("@dxos/feed-store");
@@ -631,7 +631,7 @@ var DevtoolsServiceImpl = class {
631
631
  });
632
632
  }
633
633
  };
634
- var DXOS_VERSION = "0.5.9-main.a50ff17";
634
+ var DXOS_VERSION = "0.5.9-main.af4882d";
635
635
  var getPlatform = () => {
636
636
  if (process.browser) {
637
637
  if (typeof window !== "undefined") {
@@ -4572,8 +4572,10 @@ var DataSpace = class {
4572
4572
  const root = await this._echoHost.openSpaceRoot(handle.url);
4573
4573
  this._databaseRoot = root;
4574
4574
  if (root.getVersion() !== import_echo_protocol.SpaceDocVersion.CURRENT) {
4575
- this._state = import_services12.SpaceState.REQUIRES_MIGRATION;
4576
- this.stateUpdate.emit();
4575
+ if (this._state !== import_services12.SpaceState.REQUIRES_MIGRATION) {
4576
+ this._state = import_services12.SpaceState.REQUIRES_MIGRATION;
4577
+ this.stateUpdate.emit();
4578
+ }
4577
4579
  } else {
4578
4580
  if (this._state !== import_services12.SpaceState.READY) {
4579
4581
  await this._enterReadyState();
@@ -4594,7 +4596,7 @@ var DataSpace = class {
4594
4596
  err
4595
4597
  }, {
4596
4598
  F: __dxlog_file16,
4597
- L: 431,
4599
+ L: 433,
4598
4600
  S: this,
4599
4601
  C: (f, a) => f(...a)
4600
4602
  });
@@ -4680,7 +4682,7 @@ var DataSpace = class {
4680
4682
  state: import_services12.SpaceState[this._state]
4681
4683
  }, {
4682
4684
  F: __dxlog_file16,
4683
- L: 512,
4685
+ L: 514,
4684
4686
  S: this,
4685
4687
  C: (f, a) => f(...a)
4686
4688
  });
@@ -5407,7 +5409,15 @@ var SpacesServiceImpl = class {
5407
5409
  const subscribeSpaces = () => {
5408
5410
  subscriptions.clear();
5409
5411
  for (const space of dataSpaceManager.spaces.values()) {
5410
- subscriptions.add(space.stateUpdate.on(ctx, () => scheduler.forceTrigger()));
5412
+ let lastState;
5413
+ subscriptions.add(space.stateUpdate.on(ctx, () => {
5414
+ if (space.state !== lastState) {
5415
+ scheduler.forceTrigger();
5416
+ } else {
5417
+ scheduler.trigger();
5418
+ }
5419
+ lastState = space.state;
5420
+ }));
5411
5421
  subscriptions.add(space.presence.updated.on(ctx, () => scheduler.trigger()));
5412
5422
  subscriptions.add(space.automergeSpaceState.onNewEpoch.on(ctx, () => scheduler.trigger()));
5413
5423
  subscriptions.add(space.inner.controlPipeline.state.timeframeUpdate.on(ctx, () => scheduler.trigger()));
@@ -5473,7 +5483,7 @@ var SpacesServiceImpl = class {
5473
5483
  } else {
5474
5484
  (0, import_invariant16.invariant)(!credential.id, "Id on unsigned credentials is not allowed", {
5475
5485
  F: __dxlog_file18,
5476
- L: 199,
5486
+ L: 209,
5477
5487
  S: this,
5478
5488
  A: [
5479
5489
  "!credential.id",
@@ -5482,7 +5492,7 @@ var SpacesServiceImpl = class {
5482
5492
  });
5483
5493
  (0, import_invariant16.invariant)(this._identityManager.identity, "Identity is not available", {
5484
5494
  F: __dxlog_file18,
5485
- L: 200,
5495
+ L: 210,
5486
5496
  S: this,
5487
5497
  A: [
5488
5498
  "this._identityManager.identity",
@@ -5492,7 +5502,7 @@ var SpacesServiceImpl = class {
5492
5502
  const signer = this._identityManager.identity.getIdentityCredentialSigner();
5493
5503
  (0, import_invariant16.invariant)(credential.issuer.equals(signer.getIssuer()), void 0, {
5494
5504
  F: __dxlog_file18,
5495
- L: 202,
5505
+ L: 212,
5496
5506
  S: this,
5497
5507
  A: [
5498
5508
  "credential.issuer.equals(signer.getIssuer())",
@@ -6700,4 +6710,4 @@ ClientServicesHost = _ts_decorate8([
6700
6710
  subscribeToSpaces,
6701
6711
  subscribeToSwarmInfo
6702
6712
  });
6703
- //# sourceMappingURL=chunk-E6AQJD5I.cjs.map
6713
+ //# sourceMappingURL=chunk-YO26HDFH.cjs.map