@dxos/client-services 0.6.12-main.ed7cda7 → 0.6.12-main.f9d0246
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.
- package/dist/lib/browser/{chunk-VENIOUQ4.mjs → chunk-7ONARHVD.mjs} +60 -50
- package/dist/lib/browser/chunk-7ONARHVD.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node/{chunk-US3NPCS5.cjs → chunk-UPLMIG6W.cjs} +63 -53
- package/dist/lib/node/chunk-UPLMIG6W.cjs.map +7 -0
- package/dist/lib/node/index.cjs +45 -45
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +8 -8
- package/dist/lib/node-esm/{chunk-LV7T6HCX.mjs → chunk-DSRREBQH.mjs} +60 -50
- package/dist/lib/node-esm/chunk-DSRREBQH.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts +2 -0
- package/dist/types/src/packlets/spaces/edge-feed-replicator.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/package.json +38 -38
- package/src/packlets/spaces/edge-feed-replicator.test.ts +10 -0
- package/src/packlets/spaces/edge-feed-replicator.ts +34 -22
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-VENIOUQ4.mjs.map +0 -7
- package/dist/lib/node/chunk-US3NPCS5.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-LV7T6HCX.mjs.map +0 -7
|
@@ -404,7 +404,7 @@ import { SpaceMember } from "@dxos/protocols/proto/dxos/client/services";
|
|
|
404
404
|
import { TRACE_PROCESSOR } from "@dxos/tracing";
|
|
405
405
|
|
|
406
406
|
// packages/sdk/client-services/src/version.ts
|
|
407
|
-
var DXOS_VERSION = "0.6.12-main.
|
|
407
|
+
var DXOS_VERSION = "0.6.12-main.f9d0246";
|
|
408
408
|
|
|
409
409
|
// packages/sdk/client-services/src/packlets/services/platform.ts
|
|
410
410
|
import { Platform } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -937,45 +937,31 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
937
937
|
}));
|
|
938
938
|
this._messenger.connected.on(this._ctx, async () => {
|
|
939
939
|
await this._resetConnection();
|
|
940
|
-
this.
|
|
941
|
-
const connectionCtx = new Context3({
|
|
942
|
-
onError: async (err) => {
|
|
943
|
-
if (connectionCtx !== this._connectionCtx) {
|
|
944
|
-
return;
|
|
945
|
-
}
|
|
946
|
-
if (err instanceof EdgeIdentityChangedError || err instanceof EdgeConnectionClosedError) {
|
|
947
|
-
log4("resetting on reconnect", void 0, {
|
|
948
|
-
F: __dxlog_file6,
|
|
949
|
-
L: 86,
|
|
950
|
-
S: this,
|
|
951
|
-
C: (f, a) => f(...a)
|
|
952
|
-
});
|
|
953
|
-
await this._resetConnection();
|
|
954
|
-
} else {
|
|
955
|
-
this._ctx.raise(err);
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
}, {
|
|
959
|
-
F: __dxlog_file6,
|
|
960
|
-
L: 80
|
|
961
|
-
});
|
|
962
|
-
this._connectionCtx = connectionCtx;
|
|
963
|
-
log4("connection context created", void 0, {
|
|
964
|
-
F: __dxlog_file6,
|
|
965
|
-
L: 94,
|
|
966
|
-
S: this,
|
|
967
|
-
C: (f, a) => f(...a)
|
|
968
|
-
});
|
|
969
|
-
scheduleMicroTask(connectionCtx, async () => {
|
|
970
|
-
for (const feed of this._feeds.values()) {
|
|
971
|
-
await this._replicateFeed(connectionCtx, feed);
|
|
972
|
-
}
|
|
973
|
-
});
|
|
940
|
+
this._startReplication();
|
|
974
941
|
});
|
|
942
|
+
if (this._messenger.isConnected) {
|
|
943
|
+
this._startReplication();
|
|
944
|
+
}
|
|
975
945
|
}
|
|
976
946
|
async _close() {
|
|
977
947
|
await this._resetConnection();
|
|
978
948
|
}
|
|
949
|
+
_startReplication() {
|
|
950
|
+
this._connected = true;
|
|
951
|
+
const connectionCtx = this._createConnectionContext();
|
|
952
|
+
this._connectionCtx = connectionCtx;
|
|
953
|
+
log4("connection context created", void 0, {
|
|
954
|
+
F: __dxlog_file6,
|
|
955
|
+
L: 94,
|
|
956
|
+
S: this,
|
|
957
|
+
C: (f, a) => f(...a)
|
|
958
|
+
});
|
|
959
|
+
scheduleMicroTask(connectionCtx, async () => {
|
|
960
|
+
for (const feed of this._feeds.values()) {
|
|
961
|
+
await this._replicateFeed(connectionCtx, feed);
|
|
962
|
+
}
|
|
963
|
+
});
|
|
964
|
+
}
|
|
979
965
|
async _resetConnection() {
|
|
980
966
|
this._connected = false;
|
|
981
967
|
await this._connectionCtx?.dispose();
|
|
@@ -987,7 +973,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
987
973
|
key: feed.key
|
|
988
974
|
}, {
|
|
989
975
|
F: __dxlog_file6,
|
|
990
|
-
L:
|
|
976
|
+
L: 110,
|
|
991
977
|
S: this,
|
|
992
978
|
C: (f, a) => f(...a)
|
|
993
979
|
});
|
|
@@ -1012,7 +998,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1012
998
|
if (!this._connectionCtx) {
|
|
1013
999
|
log4.info("message dropped because connection was disposed", void 0, {
|
|
1014
1000
|
F: __dxlog_file6,
|
|
1015
|
-
L:
|
|
1001
|
+
L: 135,
|
|
1016
1002
|
S: this,
|
|
1017
1003
|
C: (f, a) => f(...a)
|
|
1018
1004
|
});
|
|
@@ -1026,13 +1012,13 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1026
1012
|
};
|
|
1027
1013
|
log4.info("sending message", logPayload, {
|
|
1028
1014
|
F: __dxlog_file6,
|
|
1029
|
-
L:
|
|
1015
|
+
L: 141,
|
|
1030
1016
|
S: this,
|
|
1031
1017
|
C: (f, a) => f(...a)
|
|
1032
1018
|
});
|
|
1033
1019
|
invariant2(message.feedKey, void 0, {
|
|
1034
1020
|
F: __dxlog_file6,
|
|
1035
|
-
L:
|
|
1021
|
+
L: 143,
|
|
1036
1022
|
S: this,
|
|
1037
1023
|
A: [
|
|
1038
1024
|
"message.feedKey",
|
|
@@ -1055,7 +1041,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1055
1041
|
if (!this._connectionCtx) {
|
|
1056
1042
|
log4.warn("received message after connection context was disposed", void 0, {
|
|
1057
1043
|
F: __dxlog_file6,
|
|
1058
|
-
L:
|
|
1044
|
+
L: 160,
|
|
1059
1045
|
S: this,
|
|
1060
1046
|
C: (f, a) => f(...a)
|
|
1061
1047
|
});
|
|
@@ -1070,7 +1056,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1070
1056
|
message
|
|
1071
1057
|
}, {
|
|
1072
1058
|
F: __dxlog_file6,
|
|
1073
|
-
L:
|
|
1059
|
+
L: 166,
|
|
1074
1060
|
S: this,
|
|
1075
1061
|
C: (f, a) => f(...a)
|
|
1076
1062
|
});
|
|
@@ -1081,7 +1067,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1081
1067
|
feedKey
|
|
1082
1068
|
}, {
|
|
1083
1069
|
F: __dxlog_file6,
|
|
1084
|
-
L:
|
|
1070
|
+
L: 171,
|
|
1085
1071
|
S: this,
|
|
1086
1072
|
C: (f, a) => f(...a)
|
|
1087
1073
|
});
|
|
@@ -1114,7 +1100,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1114
1100
|
blocks: message.blocks.map((b) => b.index)
|
|
1115
1101
|
}, {
|
|
1116
1102
|
F: __dxlog_file6,
|
|
1117
|
-
L:
|
|
1103
|
+
L: 193,
|
|
1118
1104
|
S: this,
|
|
1119
1105
|
C: (f, a) => f(...a)
|
|
1120
1106
|
});
|
|
@@ -1125,7 +1111,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1125
1111
|
feedKey
|
|
1126
1112
|
}, {
|
|
1127
1113
|
F: __dxlog_file6,
|
|
1128
|
-
L:
|
|
1114
|
+
L: 198,
|
|
1129
1115
|
S: this,
|
|
1130
1116
|
C: (f, a) => f(...a)
|
|
1131
1117
|
});
|
|
@@ -1139,7 +1125,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1139
1125
|
...message
|
|
1140
1126
|
}, {
|
|
1141
1127
|
F: __dxlog_file6,
|
|
1142
|
-
L:
|
|
1128
|
+
L: 207,
|
|
1143
1129
|
S: this,
|
|
1144
1130
|
C: (f, a) => f(...a)
|
|
1145
1131
|
});
|
|
@@ -1154,7 +1140,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1154
1140
|
to
|
|
1155
1141
|
}, {
|
|
1156
1142
|
F: __dxlog_file6,
|
|
1157
|
-
L:
|
|
1143
|
+
L: 214,
|
|
1158
1144
|
S: this,
|
|
1159
1145
|
C: (f, a) => f(...a)
|
|
1160
1146
|
});
|
|
@@ -1164,7 +1150,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1164
1150
|
});
|
|
1165
1151
|
invariant2(data instanceof Uint8Array, void 0, {
|
|
1166
1152
|
F: __dxlog_file6,
|
|
1167
|
-
L:
|
|
1153
|
+
L: 219,
|
|
1168
1154
|
S: this,
|
|
1169
1155
|
A: [
|
|
1170
1156
|
"data instanceof Uint8Array",
|
|
@@ -1192,7 +1178,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1192
1178
|
blocks: blocks.length
|
|
1193
1179
|
}, {
|
|
1194
1180
|
F: __dxlog_file6,
|
|
1195
|
-
L:
|
|
1181
|
+
L: 240,
|
|
1196
1182
|
S: this,
|
|
1197
1183
|
C: (f, a) => f(...a)
|
|
1198
1184
|
});
|
|
@@ -1214,7 +1200,7 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1214
1200
|
if (!this._remoteLength.has(feed.key)) {
|
|
1215
1201
|
log4("blocks not pushed because remote length is unknown", void 0, {
|
|
1216
1202
|
F: __dxlog_file6,
|
|
1217
|
-
L:
|
|
1203
|
+
L: 261,
|
|
1218
1204
|
S: this,
|
|
1219
1205
|
C: (f, a) => f(...a)
|
|
1220
1206
|
});
|
|
@@ -1230,6 +1216,30 @@ var EdgeFeedReplicator = class extends Resource {
|
|
|
1230
1216
|
_usingCtx.d();
|
|
1231
1217
|
}
|
|
1232
1218
|
}
|
|
1219
|
+
_createConnectionContext() {
|
|
1220
|
+
const connectionCtx = new Context3({
|
|
1221
|
+
onError: async (err) => {
|
|
1222
|
+
if (connectionCtx !== this._connectionCtx) {
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
if (err instanceof EdgeIdentityChangedError || err instanceof EdgeConnectionClosedError) {
|
|
1226
|
+
log4("resetting on reconnect", void 0, {
|
|
1227
|
+
F: __dxlog_file6,
|
|
1228
|
+
L: 278,
|
|
1229
|
+
S: this,
|
|
1230
|
+
C: (f, a) => f(...a)
|
|
1231
|
+
});
|
|
1232
|
+
await this._resetConnection();
|
|
1233
|
+
} else {
|
|
1234
|
+
this._ctx.raise(err);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
}, {
|
|
1238
|
+
F: __dxlog_file6,
|
|
1239
|
+
L: 272
|
|
1240
|
+
});
|
|
1241
|
+
return connectionCtx;
|
|
1242
|
+
}
|
|
1233
1243
|
};
|
|
1234
1244
|
var bufferizeBlock = (block) => ({
|
|
1235
1245
|
index: block.index,
|
|
@@ -7957,4 +7967,4 @@ export {
|
|
|
7957
7967
|
importProfileData,
|
|
7958
7968
|
ClientServicesHost
|
|
7959
7969
|
};
|
|
7960
|
-
//# sourceMappingURL=chunk-
|
|
7970
|
+
//# sourceMappingURL=chunk-7ONARHVD.mjs.map
|