@dxos/client-services 0.7.4 → 0.7.5-main.499c70c

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.
@@ -32,7 +32,7 @@ __export(testing_exports, {
32
32
  sanitizeInvitation: () => sanitizeInvitation
33
33
  });
34
34
  module.exports = __toCommonJS(testing_exports);
35
- var import_chunk_ZS24HRVA = require("../chunk-ZS24HRVA.cjs");
35
+ var import_chunk_PHNHOPRY = require("../chunk-PHNHOPRY.cjs");
36
36
  var import_credentials = require("@dxos/credentials");
37
37
  var import_keys = require("@dxos/keys");
38
38
  var import_async = require("@dxos/async");
@@ -235,7 +235,7 @@ var createInvitation = async (host, options) => {
235
235
  authMethod: import_services.Invitation.AuthMethod.NONE,
236
236
  ...options ?? {}
237
237
  };
238
- if (host instanceof import_chunk_ZS24HRVA.ServiceContext) {
238
+ if (host instanceof import_chunk_PHNHOPRY.ServiceContext) {
239
239
  return host.invitationsManager.createInvitation({
240
240
  kind: import_services.Invitation.Kind.SPACE,
241
241
  ...options
@@ -245,7 +245,7 @@ var createInvitation = async (host, options) => {
245
245
  };
246
246
  var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
247
247
  invitation = sanitizeInvitation(invitation);
248
- if (guest instanceof import_chunk_ZS24HRVA.ServiceContext) {
248
+ if (guest instanceof import_chunk_PHNHOPRY.ServiceContext) {
249
249
  return guest.invitationsManager.acceptInvitation({
250
250
  invitation,
251
251
  deviceProfile: guestDeviceProfile
@@ -255,7 +255,7 @@ var acceptInvitation = (guest, invitation, guestDeviceProfile) => {
255
255
  };
256
256
  var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/client-services/src/packlets/testing/test-builder.ts";
257
257
  var createServiceHost = (config, signalManagerContext) => {
258
- return new import_chunk_ZS24HRVA.ClientServicesHost({
258
+ return new import_chunk_PHNHOPRY.ClientServicesHost({
259
259
  config,
260
260
  signalManager: new import_messaging.MemorySignalManager(signalManagerContext),
261
261
  transportFactory: import_network_manager.MemoryTransportFactory
@@ -274,7 +274,7 @@ var createServiceContext = async ({ signalManagerFactory = async () => {
274
274
  });
275
275
  const level = (0, import_testing.createTestLevel)();
276
276
  await level.open();
277
- return new import_chunk_ZS24HRVA.ServiceContext(storage, level, networkManager, signalManager, void 0, void 0, {
277
+ return new import_chunk_PHNHOPRY.ServiceContext(storage, level, networkManager, signalManager, void 0, void 0, {
278
278
  invitationConnectionDefaultParams: {
279
279
  teleport: {
280
280
  controlHeartbeatInterval: 200
@@ -385,7 +385,7 @@ var TestPeer = class {
385
385
  return this._props.meshEchoReplicator ??= new import_echo_pipeline.MeshEchoReplicator();
386
386
  }
387
387
  get dataSpaceManager() {
388
- return this._props.dataSpaceManager ??= new import_chunk_ZS24HRVA.DataSpaceManager({
388
+ return this._props.dataSpaceManager ??= new import_chunk_PHNHOPRY.DataSpaceManager({
389
389
  spaceManager: this.spaceManager,
390
390
  metadataStore: this.metadataStore,
391
391
  keyring: this.keyring,
@@ -400,9 +400,9 @@ var TestPeer = class {
400
400
  });
401
401
  }
402
402
  get invitationsManager() {
403
- return this._props.invitationsManager ??= new import_chunk_ZS24HRVA.InvitationsManager(new import_chunk_ZS24HRVA.InvitationsHandler(this.networkManager), (invitation) => {
403
+ return this._props.invitationsManager ??= new import_chunk_PHNHOPRY.InvitationsManager(new import_chunk_PHNHOPRY.InvitationsHandler(this.networkManager), (invitation) => {
404
404
  if (invitation.kind === import_services2.Invitation.Kind.SPACE) {
405
- return new import_chunk_ZS24HRVA.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
405
+ return new import_chunk_PHNHOPRY.SpaceInvitationProtocol(this.dataSpaceManager, this.identity, this.keyring, invitation.spaceKey);
406
406
  } else {
407
407
  throw new Error("not implemented");
408
408
  }
@@ -397,7 +397,7 @@ import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
397
397
  import { TRACE_PROCESSOR } from "@dxos/tracing";
398
398
 
399
399
  // packages/sdk/client-services/src/version.ts
400
- var DXOS_VERSION = "0.7.4";
400
+ var DXOS_VERSION = "0.7.5-main.499c70c";
401
401
 
402
402
  // packages/sdk/client-services/src/packlets/services/platform.ts
403
403
  import { Platform } from "@dxos/protocols/proto/dxos/client/services";
@@ -958,21 +958,20 @@ var EdgeFeedReplicator = class extends Resource {
958
958
  });
959
959
  return;
960
960
  }
961
- const logPayload = message.type === "data" ? {
962
- feedKey: message.feedKey,
963
- blocks: message.blocks.map((b) => b.index)
964
- } : {
965
- message
966
- };
967
- log3.info("sending message", logPayload, {
968
- F: __dxlog_file5,
969
- L: 152,
970
- S: this,
971
- C: (f, a) => f(...a)
972
- });
961
+ if (message.type === "data") {
962
+ log3.info("sending blocks", {
963
+ feedKey: message.feedKey,
964
+ blocks: message.blocks.map((b) => b.index)
965
+ }, {
966
+ F: __dxlog_file5,
967
+ L: 151,
968
+ S: this,
969
+ C: (f, a) => f(...a)
970
+ });
971
+ }
973
972
  invariant2(message.feedKey, void 0, {
974
973
  F: __dxlog_file5,
975
- L: 154,
974
+ L: 157,
976
975
  S: this,
977
976
  A: [
978
977
  "message.feedKey",
@@ -984,7 +983,7 @@ var EdgeFeedReplicator = class extends Resource {
984
983
  type: message.type
985
984
  }, {
986
985
  F: __dxlog_file5,
987
- L: 157,
986
+ L: 160,
988
987
  S: this,
989
988
  C: (f, a) => f(...a)
990
989
  });
@@ -1003,7 +1002,7 @@ var EdgeFeedReplicator = class extends Resource {
1003
1002
  if (!this._connectionCtx) {
1004
1003
  log3.warn("received message after connection context was disposed", void 0, {
1005
1004
  F: __dxlog_file5,
1006
- L: 172,
1005
+ L: 175,
1007
1006
  S: this,
1008
1007
  C: (f, a) => f(...a)
1009
1008
  });
@@ -1014,14 +1013,6 @@ var EdgeFeedReplicator = class extends Resource {
1014
1013
  case "metadata": {
1015
1014
  try {
1016
1015
  var _usingCtx = _using_ctx();
1017
- log3.info("received metadata", {
1018
- message
1019
- }, {
1020
- F: __dxlog_file5,
1021
- L: 178,
1022
- S: this,
1023
- C: (f, a) => f(...a)
1024
- });
1025
1016
  const feedKey = PublicKey3.fromHex(message.feedKey);
1026
1017
  const feed = this._feeds.get(feedKey);
1027
1018
  if (!feed) {
@@ -1029,7 +1020,7 @@ var EdgeFeedReplicator = class extends Resource {
1029
1020
  feedKey
1030
1021
  }, {
1031
1022
  F: __dxlog_file5,
1032
- L: 183,
1023
+ L: 184,
1033
1024
  S: this,
1034
1025
  C: (f, a) => f(...a)
1035
1026
  });
@@ -1037,7 +1028,18 @@ var EdgeFeedReplicator = class extends Resource {
1037
1028
  }
1038
1029
  const _guard = _usingCtx.u(await this._getPushMutex(feed.key).acquire());
1039
1030
  this._remoteLength.set(feedKey, message.length);
1031
+ const logMeta = {
1032
+ localLength: feed.length,
1033
+ remoteLength: message.length,
1034
+ feedKey
1035
+ };
1040
1036
  if (message.length > feed.length) {
1037
+ log3.info("requesting missing blocks", logMeta, {
1038
+ F: __dxlog_file5,
1039
+ L: 194,
1040
+ S: this,
1041
+ C: (f, a) => f(...a)
1042
+ });
1041
1043
  await this._sendMessage({
1042
1044
  type: "request",
1043
1045
  feedKey: feedKey.toHex(),
@@ -1047,6 +1049,12 @@ var EdgeFeedReplicator = class extends Resource {
1047
1049
  }
1048
1050
  });
1049
1051
  } else if (message.length < feed.length) {
1052
+ log3.info("pushing blocks to remote", logMeta, {
1053
+ F: __dxlog_file5,
1054
+ L: 202,
1055
+ S: this,
1056
+ C: (f, a) => f(...a)
1057
+ });
1050
1058
  await this._pushBlocks(feed, message.length, feed.length);
1051
1059
  }
1052
1060
  break;
@@ -1062,7 +1070,7 @@ var EdgeFeedReplicator = class extends Resource {
1062
1070
  blocks: message.blocks.map((b) => b.index)
1063
1071
  }, {
1064
1072
  F: __dxlog_file5,
1065
- L: 205,
1073
+ L: 211,
1066
1074
  S: this,
1067
1075
  C: (f, a) => f(...a)
1068
1076
  });
@@ -1073,7 +1081,7 @@ var EdgeFeedReplicator = class extends Resource {
1073
1081
  feedKey
1074
1082
  }, {
1075
1083
  F: __dxlog_file5,
1076
- L: 210,
1084
+ L: 216,
1077
1085
  S: this,
1078
1086
  C: (f, a) => f(...a)
1079
1087
  });
@@ -1087,7 +1095,7 @@ var EdgeFeedReplicator = class extends Resource {
1087
1095
  ...message
1088
1096
  }, {
1089
1097
  F: __dxlog_file5,
1090
- L: 219,
1098
+ L: 225,
1091
1099
  S: this,
1092
1100
  C: (f, a) => f(...a)
1093
1101
  });
@@ -1102,7 +1110,7 @@ var EdgeFeedReplicator = class extends Resource {
1102
1110
  to
1103
1111
  }, {
1104
1112
  F: __dxlog_file5,
1105
- L: 226,
1113
+ L: 232,
1106
1114
  S: this,
1107
1115
  C: (f, a) => f(...a)
1108
1116
  });
@@ -1112,7 +1120,7 @@ var EdgeFeedReplicator = class extends Resource {
1112
1120
  });
1113
1121
  invariant2(data instanceof Uint8Array, void 0, {
1114
1122
  F: __dxlog_file5,
1115
- L: 231,
1123
+ L: 237,
1116
1124
  S: this,
1117
1125
  A: [
1118
1126
  "data instanceof Uint8Array",
@@ -1140,7 +1148,7 @@ var EdgeFeedReplicator = class extends Resource {
1140
1148
  blocks: blocks.length
1141
1149
  }, {
1142
1150
  F: __dxlog_file5,
1143
- L: 252,
1151
+ L: 258,
1144
1152
  S: this,
1145
1153
  C: (f, a) => f(...a)
1146
1154
  });
@@ -1162,7 +1170,7 @@ var EdgeFeedReplicator = class extends Resource {
1162
1170
  if (!this._remoteLength.has(feed.key)) {
1163
1171
  log3("blocks not pushed because remote length is unknown", void 0, {
1164
1172
  F: __dxlog_file5,
1165
- L: 273,
1173
+ L: 279,
1166
1174
  S: this,
1167
1175
  C: (f, a) => f(...a)
1168
1176
  });
@@ -1187,7 +1195,7 @@ var EdgeFeedReplicator = class extends Resource {
1187
1195
  if (err instanceof EdgeIdentityChangedError || err instanceof EdgeConnectionClosedError) {
1188
1196
  log3("resetting on reconnect", void 0, {
1189
1197
  F: __dxlog_file5,
1190
- L: 290,
1198
+ L: 296,
1191
1199
  S: this,
1192
1200
  C: (f, a) => f(...a)
1193
1201
  });
@@ -1198,7 +1206,7 @@ var EdgeFeedReplicator = class extends Resource {
1198
1206
  }
1199
1207
  }, {
1200
1208
  F: __dxlog_file5,
1201
- L: 284
1209
+ L: 290
1202
1210
  });
1203
1211
  return connectionCtx;
1204
1212
  }
@@ -7748,7 +7756,7 @@ var ServiceContext = class extends Resource7 {
7748
7756
  let edgeIdentity;
7749
7757
  const identity = this.identityManager.identity;
7750
7758
  if (identity) {
7751
- log23.info("Setting identity on edge connection", {
7759
+ log23("setting identity on edge connection", {
7752
7760
  identity: identity.identityKey.toHex(),
7753
7761
  swarms: this.networkManager.topics
7754
7762
  }, {
@@ -7767,7 +7775,7 @@ var ServiceContext = class extends Resource7 {
7767
7775
  });
7768
7776
  invariant21(identity.deviceCredentialChain, void 0, {
7769
7777
  F: __dxlog_file27,
7770
- L: 401,
7778
+ L: 402,
7771
7779
  S: this,
7772
7780
  A: [
7773
7781
  "identity.deviceCredentialChain",
@@ -8910,4 +8918,4 @@ export {
8910
8918
  importProfileData,
8911
8919
  ClientServicesHost
8912
8920
  };
8913
- //# sourceMappingURL=chunk-OQOXRHWF.mjs.map
8921
+ //# sourceMappingURL=chunk-5LEHZOCS.mjs.map