@dxos/client-services 0.5.9-main.d63ef8d → 0.5.9-main.d787c80

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-C2VXW65X.mjs";
10
+ } from "../../chunk-IENZTAYS.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_OD7BTUYY_exports = {};
30
- __export(chunk_OD7BTUYY_exports, {
29
+ var chunk_5HST3TVX_exports = {};
30
+ __export(chunk_5HST3TVX_exports, {
31
31
  ClientRpcServer: () => ClientRpcServer,
32
32
  ClientServicesHost: () => ClientServicesHost,
33
33
  ClientServicesProviderResource: () => ClientServicesProviderResource,
@@ -66,7 +66,7 @@ __export(chunk_OD7BTUYY_exports, {
66
66
  subscribeToSpaces: () => subscribeToSpaces,
67
67
  subscribeToSwarmInfo: () => subscribeToSwarmInfo
68
68
  });
69
- module.exports = __toCommonJS(chunk_OD7BTUYY_exports);
69
+ module.exports = __toCommonJS(chunk_5HST3TVX_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.d63ef8d";
634
+ var DXOS_VERSION = "0.5.9-main.d787c80";
635
635
  var getPlatform = () => {
636
636
  if (process.browser) {
637
637
  if (typeof window !== "undefined") {
@@ -4545,7 +4545,6 @@ var DataSpace = class {
4545
4545
  S: this,
4546
4546
  C: (f, a) => f(...a)
4547
4547
  });
4548
- this._echoHost.replicateDocument(rootUrl);
4549
4548
  const handle = this._echoHost.automergeRepo.find(rootUrl);
4550
4549
  queueMicrotask(async () => {
4551
4550
  try {
@@ -4572,8 +4571,10 @@ var DataSpace = class {
4572
4571
  const root = await this._echoHost.openSpaceRoot(handle.url);
4573
4572
  this._databaseRoot = root;
4574
4573
  if (root.getVersion() !== import_echo_protocol.SpaceDocVersion.CURRENT) {
4575
- this._state = import_services12.SpaceState.REQUIRES_MIGRATION;
4576
- this.stateUpdate.emit();
4574
+ if (this._state !== import_services12.SpaceState.REQUIRES_MIGRATION) {
4575
+ this._state = import_services12.SpaceState.REQUIRES_MIGRATION;
4576
+ this.stateUpdate.emit();
4577
+ }
4577
4578
  } else {
4578
4579
  if (this._state !== import_services12.SpaceState.READY) {
4579
4580
  await this._enterReadyState();
@@ -5407,7 +5408,15 @@ var SpacesServiceImpl = class {
5407
5408
  const subscribeSpaces = () => {
5408
5409
  subscriptions.clear();
5409
5410
  for (const space of dataSpaceManager.spaces.values()) {
5410
- subscriptions.add(space.stateUpdate.on(ctx, () => scheduler.forceTrigger()));
5411
+ let lastState;
5412
+ subscriptions.add(space.stateUpdate.on(ctx, () => {
5413
+ if (space.state !== lastState) {
5414
+ scheduler.forceTrigger();
5415
+ } else {
5416
+ scheduler.trigger();
5417
+ }
5418
+ lastState = space.state;
5419
+ }));
5411
5420
  subscriptions.add(space.presence.updated.on(ctx, () => scheduler.trigger()));
5412
5421
  subscriptions.add(space.automergeSpaceState.onNewEpoch.on(ctx, () => scheduler.trigger()));
5413
5422
  subscriptions.add(space.inner.controlPipeline.state.timeframeUpdate.on(ctx, () => scheduler.trigger()));
@@ -5473,7 +5482,7 @@ var SpacesServiceImpl = class {
5473
5482
  } else {
5474
5483
  (0, import_invariant16.invariant)(!credential.id, "Id on unsigned credentials is not allowed", {
5475
5484
  F: __dxlog_file18,
5476
- L: 199,
5485
+ L: 209,
5477
5486
  S: this,
5478
5487
  A: [
5479
5488
  "!credential.id",
@@ -5482,7 +5491,7 @@ var SpacesServiceImpl = class {
5482
5491
  });
5483
5492
  (0, import_invariant16.invariant)(this._identityManager.identity, "Identity is not available", {
5484
5493
  F: __dxlog_file18,
5485
- L: 200,
5494
+ L: 210,
5486
5495
  S: this,
5487
5496
  A: [
5488
5497
  "this._identityManager.identity",
@@ -5492,7 +5501,7 @@ var SpacesServiceImpl = class {
5492
5501
  const signer = this._identityManager.identity.getIdentityCredentialSigner();
5493
5502
  (0, import_invariant16.invariant)(credential.issuer.equals(signer.getIssuer()), void 0, {
5494
5503
  F: __dxlog_file18,
5495
- L: 202,
5504
+ L: 212,
5496
5505
  S: this,
5497
5506
  A: [
5498
5507
  "credential.issuer.equals(signer.getIssuer())",
@@ -6700,4 +6709,4 @@ ClientServicesHost = _ts_decorate8([
6700
6709
  subscribeToSpaces,
6701
6710
  subscribeToSwarmInfo
6702
6711
  });
6703
- //# sourceMappingURL=chunk-OD7BTUYY.cjs.map
6712
+ //# sourceMappingURL=chunk-5HST3TVX.cjs.map