@dxos/network-manager 0.4.10-main.f68a1ca → 0.4.10-main.fd4f2a3
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-2QQJJZJQ.mjs → chunk-OIR45T43.mjs} +22 -11
- package/dist/lib/browser/{chunk-2QQJJZJQ.mjs.map → chunk-OIR45T43.mjs.map} +3 -3
- 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-IWG3IC7H.cjs → chunk-HUPX2JGP.cjs} +25 -14
- package/dist/lib/node/{chunk-IWG3IC7H.cjs.map → chunk-HUPX2JGP.cjs.map} +3 -3
- package/dist/lib/node/index.cjs +27 -27
- package/dist/lib/node/index.cjs.map +1 -1
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +18 -18
- package/dist/types/src/transport/simplepeer-transport-proxy.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/transport/simplepeer-transport-proxy.ts +21 -13
|
@@ -3244,6 +3244,7 @@ import { ConnectionResetError as ConnectionResetError3, TimeoutError as TimeoutE
|
|
|
3244
3244
|
import { ConnectionState as ConnectionState4 } from "@dxos/protocols/proto/dxos/mesh/bridge";
|
|
3245
3245
|
import { arrayToBuffer } from "@dxos/util";
|
|
3246
3246
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/core/mesh/network-manager/src/transport/simplepeer-transport-proxy.ts";
|
|
3247
|
+
var RPC_TIMEOUT = 1e4;
|
|
3247
3248
|
var RESP_MIN_THRESHOLD = 500;
|
|
3248
3249
|
var TIMEOUT_THRESHOLD = 10;
|
|
3249
3250
|
var SimplePeerTransportProxy = class {
|
|
@@ -3259,12 +3260,14 @@ var SimplePeerTransportProxy = class {
|
|
|
3259
3260
|
this._serviceStream = this._params.bridgeService.open({
|
|
3260
3261
|
proxyId: this._proxyId,
|
|
3261
3262
|
initiator: this._params.initiator
|
|
3263
|
+
}, {
|
|
3264
|
+
timeout: RPC_TIMEOUT
|
|
3262
3265
|
});
|
|
3263
3266
|
this._serviceStream.waitUntilReady().then(() => {
|
|
3264
3267
|
this._serviceStream.subscribe(async (event) => {
|
|
3265
3268
|
log13("SimplePeerTransportProxy: event", event, {
|
|
3266
3269
|
F: __dxlog_file14,
|
|
3267
|
-
L:
|
|
3270
|
+
L: 63,
|
|
3268
3271
|
S: this,
|
|
3269
3272
|
C: (f, a) => f(...a)
|
|
3270
3273
|
});
|
|
@@ -3283,12 +3286,12 @@ var SimplePeerTransportProxy = class {
|
|
|
3283
3286
|
proxyId: this._proxyId,
|
|
3284
3287
|
payload: chunk
|
|
3285
3288
|
}, {
|
|
3286
|
-
timeout:
|
|
3289
|
+
timeout: RPC_TIMEOUT
|
|
3287
3290
|
}).then(() => {
|
|
3288
3291
|
if (performance.now() - then > RESP_MIN_THRESHOLD) {
|
|
3289
3292
|
log13("slow response, delaying callback", void 0, {
|
|
3290
3293
|
F: __dxlog_file14,
|
|
3291
|
-
L:
|
|
3294
|
+
L: 87,
|
|
3292
3295
|
S: this,
|
|
3293
3296
|
C: (f, a) => f(...a)
|
|
3294
3297
|
});
|
|
@@ -3300,11 +3303,11 @@ var SimplePeerTransportProxy = class {
|
|
|
3300
3303
|
}, (err) => {
|
|
3301
3304
|
if (err instanceof TimeoutError3 || err.constructor.name === "TimeoutError") {
|
|
3302
3305
|
if (this._timeoutCount++ > TIMEOUT_THRESHOLD) {
|
|
3303
|
-
throw new TimeoutError3(`too many
|
|
3306
|
+
throw new TimeoutError3(`too many timeouts (${this._timeoutCount} > ${TIMEOUT_THRESHOLD}`);
|
|
3304
3307
|
} else {
|
|
3305
3308
|
log13("timeout error, but still invoking callback", void 0, {
|
|
3306
3309
|
F: __dxlog_file14,
|
|
3307
|
-
L:
|
|
3310
|
+
L: 99,
|
|
3308
3311
|
S: this,
|
|
3309
3312
|
C: (f, a) => f(...a)
|
|
3310
3313
|
});
|
|
@@ -3313,7 +3316,7 @@ var SimplePeerTransportProxy = class {
|
|
|
3313
3316
|
} else {
|
|
3314
3317
|
log13.catch(err, void 0, {
|
|
3315
3318
|
F: __dxlog_file14,
|
|
3316
|
-
L:
|
|
3319
|
+
L: 103,
|
|
3317
3320
|
S: this,
|
|
3318
3321
|
C: (f, a) => f(...a)
|
|
3319
3322
|
});
|
|
@@ -3326,7 +3329,7 @@ var SimplePeerTransportProxy = class {
|
|
|
3326
3329
|
err
|
|
3327
3330
|
}, {
|
|
3328
3331
|
F: __dxlog_file14,
|
|
3329
|
-
L:
|
|
3332
|
+
L: 111,
|
|
3330
3333
|
S: this,
|
|
3331
3334
|
C: (f, a) => f(...a)
|
|
3332
3335
|
});
|
|
@@ -3334,7 +3337,7 @@ var SimplePeerTransportProxy = class {
|
|
|
3334
3337
|
this._params.stream.pipe(proxyStream);
|
|
3335
3338
|
}, (error) => log13.catch(error, void 0, {
|
|
3336
3339
|
F: __dxlog_file14,
|
|
3337
|
-
L:
|
|
3340
|
+
L: 116,
|
|
3338
3341
|
S: this,
|
|
3339
3342
|
C: (f, a) => f(...a)
|
|
3340
3343
|
}));
|
|
@@ -3364,16 +3367,22 @@ var SimplePeerTransportProxy = class {
|
|
|
3364
3367
|
this._params.bridgeService.sendSignal({
|
|
3365
3368
|
proxyId: this._proxyId,
|
|
3366
3369
|
signal
|
|
3370
|
+
}, {
|
|
3371
|
+
timeout: RPC_TIMEOUT
|
|
3367
3372
|
}).catch((err) => this.errors.raise(decodeError(err)));
|
|
3368
3373
|
}
|
|
3369
3374
|
async getDetails() {
|
|
3370
3375
|
return (await this._params.bridgeService.getDetails({
|
|
3371
3376
|
proxyId: this._proxyId
|
|
3377
|
+
}, {
|
|
3378
|
+
timeout: RPC_TIMEOUT
|
|
3372
3379
|
})).details;
|
|
3373
3380
|
}
|
|
3374
3381
|
async getStats() {
|
|
3375
3382
|
return (await this._params.bridgeService.getStats({
|
|
3376
3383
|
proxyId: this._proxyId
|
|
3384
|
+
}, {
|
|
3385
|
+
timeout: RPC_TIMEOUT
|
|
3377
3386
|
})).stats;
|
|
3378
3387
|
}
|
|
3379
3388
|
// TODO(burdon): Move open from constructor.
|
|
@@ -3386,11 +3395,13 @@ var SimplePeerTransportProxy = class {
|
|
|
3386
3395
|
try {
|
|
3387
3396
|
await this._params.bridgeService.close({
|
|
3388
3397
|
proxyId: this._proxyId
|
|
3398
|
+
}, {
|
|
3399
|
+
timeout: RPC_TIMEOUT
|
|
3389
3400
|
});
|
|
3390
3401
|
} catch (err) {
|
|
3391
3402
|
log13.catch(err, void 0, {
|
|
3392
3403
|
F: __dxlog_file14,
|
|
3393
|
-
L:
|
|
3404
|
+
L: 179,
|
|
3394
3405
|
S: this,
|
|
3395
3406
|
C: (f, a) => f(...a)
|
|
3396
3407
|
});
|
|
@@ -3426,7 +3437,7 @@ var SimplePeerTransportProxyFactory = class {
|
|
|
3426
3437
|
createTransport(options) {
|
|
3427
3438
|
invariant13(this._bridgeService, "SimplePeerTransportProxyFactory is not ready to open connections", {
|
|
3428
3439
|
F: __dxlog_file14,
|
|
3429
|
-
L:
|
|
3440
|
+
L: 216,
|
|
3430
3441
|
S: this,
|
|
3431
3442
|
A: [
|
|
3432
3443
|
"this._bridgeService",
|
|
@@ -3952,4 +3963,4 @@ export {
|
|
|
3952
3963
|
TcpTransport,
|
|
3953
3964
|
createTeleportProtocolFactory
|
|
3954
3965
|
};
|
|
3955
|
-
//# sourceMappingURL=chunk-
|
|
3966
|
+
//# sourceMappingURL=chunk-OIR45T43.mjs.map
|