@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.
@@ -30,7 +30,7 @@ __export(testing_exports, {
30
30
  sanitizeInvitation: () => sanitizeInvitation
31
31
  });
32
32
  module.exports = __toCommonJS(testing_exports);
33
- var import_chunk_OD7BTUYY = require("../../chunk-OD7BTUYY.cjs");
33
+ var import_chunk_5HST3TVX = require("../../chunk-5HST3TVX.cjs");
34
34
  var import_credentials = require("@dxos/credentials");
35
35
  var import_keys = require("@dxos/keys");
36
36
  var import_async = require("@dxos/async");
@@ -227,7 +227,7 @@ var createInvitation = async (host, options) => {
227
227
  authMethod: import_services.Invitation.AuthMethod.NONE,
228
228
  ...options ?? {}
229
229
  };
230
- if (host instanceof import_chunk_OD7BTUYY.ServiceContext) {
230
+ if (host instanceof import_chunk_5HST3TVX.ServiceContext) {
231
231
  return host.invitationsManager.createInvitation({
232
232
  kind: import_services.Invitation.Kind.SPACE,
233
233
  ...options
@@ -237,7 +237,7 @@ var createInvitation = async (host, options) => {
237
237
  };
238
238
  var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
239
239
  invitation = sanitizeInvitation(invitation);
240
- if (guest instanceof import_chunk_OD7BTUYY.ServiceContext) {
240
+ if (guest instanceof import_chunk_5HST3TVX.ServiceContext) {
241
241
  return guest.invitationsManager.acceptInvitation({
242
242
  invitation,
243
243
  deviceProfile: guestDeviceProfile
@@ -246,7 +246,7 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
246
246
  return guest.join(invitation, guestDeviceProfile);
247
247
  };
248
248
  var createServiceHost = (config, signalManagerContext) => {
249
- return new import_chunk_OD7BTUYY.ClientServicesHost({
249
+ return new import_chunk_5HST3TVX.ClientServicesHost({
250
250
  config,
251
251
  signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
252
252
  transportFactory: import_network_manager.MemoryTransportFactory
@@ -262,7 +262,7 @@ var createServiceContext = async ({ signalContext = new import_messaging.MemoryS
262
262
  });
263
263
  const level = (0, import_testing.createTestLevel)();
264
264
  await level.open();
265
- return new import_chunk_OD7BTUYY.ServiceContext(storage, level, networkManager, signalManager, {
265
+ return new import_chunk_5HST3TVX.ServiceContext(storage, level, networkManager, signalManager, {
266
266
  invitationConnectionDefaultParams: {
267
267
  controlHeartbeatInterval: 200
268
268
  },
@@ -363,12 +363,12 @@ var TestPeer = class {
363
363
  });
364
364
  }
365
365
  get dataSpaceManager() {
366
- return this._props.dataSpaceManager ??= new import_chunk_OD7BTUYY.DataSpaceManager(this.spaceManager, this.metadataStore, this.keyring, this.identity, this.feedStore, this.echoHost, this.invitationsManager, this._opts.dataSpaceParams);
366
+ return this._props.dataSpaceManager ??= new import_chunk_5HST3TVX.DataSpaceManager(this.spaceManager, this.metadataStore, this.keyring, this.identity, this.feedStore, this.echoHost, this.invitationsManager, this._opts.dataSpaceParams);
367
367
  }
368
368
  get invitationsManager() {
369
- return this._props.invitationsManager ??= new import_chunk_OD7BTUYY.InvitationsManager(new import_chunk_OD7BTUYY.InvitationsHandler(this.networkManager), (invitation) => {
369
+ return this._props.invitationsManager ??= new import_chunk_5HST3TVX.InvitationsManager(new import_chunk_5HST3TVX.InvitationsHandler(this.networkManager), (invitation) => {
370
370
  if (invitation.kind === import_services2.Invitation.Kind.SPACE) {
371
- return new import_chunk_OD7BTUYY.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
371
+ return new import_chunk_5HST3TVX.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
372
372
  } else {
373
373
  throw new Error("not implemented");
374
374
  }
@@ -1 +1 @@
1
- {"version":3,"file":"spaces-service.d.ts","sourceRoot":"","sources":["../../../../../src/packlets/spaces/spaces-service.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,KAAK,YAAY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CAAC,oBAAoB;gBAFpB,gBAAgB,EAAE,eAAe,EACjC,aAAa,EAAE,YAAY,EAC3B,oBAAoB,EAAE,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAGtE,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC;IAQ7B,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,kBAAkB;IAmBnD,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BvE,WAAW,IAAI,MAAM,CAAC,mBAAmB,CAAC;IA6DpC,WAAW,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,kBAAkB;IAMpE,iBAAiB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,wBAAwB;IAajE,gBAAgB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,uBAAuB,GAAG,MAAM,CAAC,UAAU,CAAC;IAmB7E,gBAAgB,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,uBAAuB;IAmBnE,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAO9G,OAAO,CAAC,eAAe;IA6CvB,OAAO,CAAC,gBAAgB;YASV,cAAc;CAS7B"}
@@ -1,2 +1,2 @@
1
- export declare const DXOS_VERSION = "0.5.9-main.d63ef8d";
1
+ export declare const DXOS_VERSION = "0.5.9-main.d787c80";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/client-services",
3
- "version": "0.5.9-main.d63ef8d",
3
+ "version": "0.5.9-main.d787c80",
4
4
  "description": "DXOS client services implementation",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -23,45 +23,45 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "platform": "^1.3.6",
26
- "@dxos/async": "0.5.9-main.d63ef8d",
27
- "@dxos/automerge": "0.5.9-main.d63ef8d",
28
- "@dxos/client-protocol": "0.5.9-main.d63ef8d",
29
- "@dxos/codec-protobuf": "0.5.9-main.d63ef8d",
30
- "@dxos/config": "0.5.9-main.d63ef8d",
31
- "@dxos/context": "0.5.9-main.d63ef8d",
32
- "@dxos/credentials": "0.5.9-main.d63ef8d",
33
- "@dxos/crypto": "0.5.9-main.d63ef8d",
34
- "@dxos/debug": "0.5.9-main.d63ef8d",
35
- "@dxos/echo-db": "0.5.9-main.d63ef8d",
36
- "@dxos/echo-pipeline": "0.5.9-main.d63ef8d",
37
- "@dxos/echo-protocol": "0.5.9-main.d63ef8d",
38
- "@dxos/echo-schema": "0.5.9-main.d63ef8d",
39
- "@dxos/invariant": "0.5.9-main.d63ef8d",
40
- "@dxos/feed-store": "0.5.9-main.d63ef8d",
41
- "@dxos/indexing": "0.5.9-main.d63ef8d",
42
- "@dxos/keyring": "0.5.9-main.d63ef8d",
43
- "@dxos/keys": "0.5.9-main.d63ef8d",
44
- "@dxos/kv-store": "0.5.9-main.d63ef8d",
45
- "@dxos/lock-file": "0.5.9-main.d63ef8d",
46
- "@dxos/log": "0.5.9-main.d63ef8d",
47
- "@dxos/network-manager": "0.5.9-main.d63ef8d",
48
- "@dxos/messaging": "0.5.9-main.d63ef8d",
49
- "@dxos/node-std": "0.5.9-main.d63ef8d",
50
- "@dxos/protocols": "0.5.9-main.d63ef8d",
51
- "@dxos/random-access-storage": "0.5.9-main.d63ef8d",
52
- "@dxos/rpc": "0.5.9-main.d63ef8d",
53
- "@dxos/teleport": "0.5.9-main.d63ef8d",
54
- "@dxos/teleport-extension-object-sync": "0.5.9-main.d63ef8d",
55
- "@dxos/teleport-extension-gossip": "0.5.9-main.d63ef8d",
56
- "@dxos/tracing": "0.5.9-main.d63ef8d",
57
- "@dxos/timeframe": "0.5.9-main.d63ef8d",
58
- "@dxos/util": "0.5.9-main.d63ef8d",
59
- "@dxos/websocket-rpc": "0.5.9-main.d63ef8d"
26
+ "@dxos/async": "0.5.9-main.d787c80",
27
+ "@dxos/client-protocol": "0.5.9-main.d787c80",
28
+ "@dxos/codec-protobuf": "0.5.9-main.d787c80",
29
+ "@dxos/config": "0.5.9-main.d787c80",
30
+ "@dxos/context": "0.5.9-main.d787c80",
31
+ "@dxos/credentials": "0.5.9-main.d787c80",
32
+ "@dxos/debug": "0.5.9-main.d787c80",
33
+ "@dxos/echo-db": "0.5.9-main.d787c80",
34
+ "@dxos/echo-pipeline": "0.5.9-main.d787c80",
35
+ "@dxos/crypto": "0.5.9-main.d787c80",
36
+ "@dxos/echo-protocol": "0.5.9-main.d787c80",
37
+ "@dxos/echo-schema": "0.5.9-main.d787c80",
38
+ "@dxos/indexing": "0.5.9-main.d787c80",
39
+ "@dxos/automerge": "0.5.9-main.d787c80",
40
+ "@dxos/feed-store": "0.5.9-main.d787c80",
41
+ "@dxos/invariant": "0.5.9-main.d787c80",
42
+ "@dxos/keyring": "0.5.9-main.d787c80",
43
+ "@dxos/keys": "0.5.9-main.d787c80",
44
+ "@dxos/kv-store": "0.5.9-main.d787c80",
45
+ "@dxos/lock-file": "0.5.9-main.d787c80",
46
+ "@dxos/messaging": "0.5.9-main.d787c80",
47
+ "@dxos/network-manager": "0.5.9-main.d787c80",
48
+ "@dxos/log": "0.5.9-main.d787c80",
49
+ "@dxos/node-std": "0.5.9-main.d787c80",
50
+ "@dxos/protocols": "0.5.9-main.d787c80",
51
+ "@dxos/rpc": "0.5.9-main.d787c80",
52
+ "@dxos/random-access-storage": "0.5.9-main.d787c80",
53
+ "@dxos/teleport": "0.5.9-main.d787c80",
54
+ "@dxos/teleport-extension-object-sync": "0.5.9-main.d787c80",
55
+ "@dxos/teleport-extension-gossip": "0.5.9-main.d787c80",
56
+ "@dxos/timeframe": "0.5.9-main.d787c80",
57
+ "@dxos/tracing": "0.5.9-main.d787c80",
58
+ "@dxos/util": "0.5.9-main.d787c80",
59
+ "@dxos/websocket-rpc": "0.5.9-main.d787c80"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/platform": "^1.3.4",
63
63
  "@types/readable-stream": "^2.3.9",
64
- "@dxos/signal": "0.5.9-main.d63ef8d"
64
+ "@dxos/signal": "0.5.9-main.d787c80"
65
65
  },
66
66
  "publishConfig": {
67
67
  "access": "public"
@@ -386,9 +386,7 @@ export class DataSpace {
386
386
 
387
387
  private _onNewAutomergeRoot(rootUrl: string) {
388
388
  log('loading automerge root doc for space', { space: this.key, rootUrl });
389
- // Override share policy = true for the root document.
390
- // Workaround for https://github.com/automerge/automerge-repo/pull/292
391
- this._echoHost.replicateDocument(rootUrl);
389
+
392
390
  const handle = this._echoHost.automergeRepo.find(rootUrl as any);
393
391
 
394
392
  // TODO(dmaretskyi): Make this single-threaded (but doc loading should still be parallel to not block epoch processing).
@@ -417,8 +415,10 @@ export class DataSpace {
417
415
  const root = await this._echoHost.openSpaceRoot(handle.url);
418
416
  this._databaseRoot = root;
419
417
  if (root.getVersion() !== SpaceDocVersion.CURRENT) {
420
- this._state = SpaceState.REQUIRES_MIGRATION;
421
- this.stateUpdate.emit();
418
+ if (this._state !== SpaceState.REQUIRES_MIGRATION) {
419
+ this._state = SpaceState.REQUIRES_MIGRATION;
420
+ this.stateUpdate.emit();
421
+ }
422
422
  } else {
423
423
  if (this._state !== SpaceState.READY) {
424
424
  await this._enterReadyState();
@@ -126,8 +126,18 @@ export class SpacesServiceImpl implements SpacesService {
126
126
  subscriptions.clear();
127
127
 
128
128
  for (const space of dataSpaceManager.spaces.values()) {
129
- // TODO(dmaretskyi): This can skip updates and not report intermediate states. Potential race condition here.
130
- subscriptions.add(space.stateUpdate.on(ctx, () => scheduler.forceTrigger()));
129
+ let lastState: SpaceState | undefined;
130
+ subscriptions.add(
131
+ space.stateUpdate.on(ctx, () => {
132
+ // Always send a separate update if the space state has changed.
133
+ if (space.state !== lastState) {
134
+ scheduler.forceTrigger();
135
+ } else {
136
+ scheduler.trigger();
137
+ }
138
+ lastState = space.state;
139
+ }),
140
+ );
131
141
 
132
142
  subscriptions.add(space.presence.updated.on(ctx, () => scheduler.trigger()));
133
143
  subscriptions.add(space.automergeSpaceState.onNewEpoch.on(ctx, () => scheduler.trigger()));
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const DXOS_VERSION = "0.5.9-main.d63ef8d";
1
+ export const DXOS_VERSION = "0.5.9-main.d787c80";