@replit/river 0.23.10 → 0.23.11
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/{chunk-KBAZ5TWE.js → chunk-EOJMKMDO.js} +32 -40
- package/dist/chunk-EOJMKMDO.js.map +1 -0
- package/dist/{chunk-Z4G27Y2I.js → chunk-HM7VDTDJ.js} +2 -2
- package/dist/{chunk-FRICSBDW.js → chunk-MEHCOYKJ.js} +2 -2
- package/dist/{chunk-FRICSBDW.js.map → chunk-MEHCOYKJ.js.map} +1 -1
- package/dist/{chunk-UXQMGZKP.js → chunk-T6YEMFUF.js} +2 -2
- package/dist/{chunk-B323CECK.js → chunk-ZSKCZYVU.js} +9 -9
- package/dist/chunk-ZSKCZYVU.js.map +1 -0
- package/dist/{connection-700340c4.d.ts → connection-261eee8f.d.ts} +1 -1
- package/dist/{connection-efcd4e1a.d.ts → connection-c1eeb95d.d.ts} +1 -1
- package/dist/router/index.cjs +8 -8
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +11 -7
- package/dist/router/index.d.ts +11 -7
- package/dist/router/index.js +2 -2
- package/dist/{services-409c5545.d.ts → services-524bab79.d.ts} +1 -1
- package/dist/transport/impls/uds/client.cjs +30 -38
- package/dist/transport/impls/uds/client.cjs.map +1 -1
- package/dist/transport/impls/uds/client.d.cts +2 -2
- package/dist/transport/impls/uds/client.d.ts +2 -2
- package/dist/transport/impls/uds/client.js +3 -3
- package/dist/transport/impls/uds/server.cjs +10 -29
- package/dist/transport/impls/uds/server.cjs.map +1 -1
- package/dist/transport/impls/uds/server.d.cts +2 -2
- package/dist/transport/impls/uds/server.d.ts +2 -2
- package/dist/transport/impls/uds/server.js +3 -3
- package/dist/transport/impls/ws/client.cjs +30 -38
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +2 -2
- package/dist/transport/impls/ws/client.d.ts +2 -2
- package/dist/transport/impls/ws/client.js +3 -3
- package/dist/transport/impls/ws/server.cjs +10 -29
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +2 -2
- package/dist/transport/impls/ws/server.d.ts +2 -2
- package/dist/transport/impls/ws/server.js +3 -3
- package/dist/transport/index.cjs +31 -39
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +2 -2
- package/dist/{transport-cf856c41.d.ts → transport-c8f36f6d.d.ts} +2 -4
- package/dist/util/testHelpers.cjs +4 -21
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +2 -2
- package/dist/util/testHelpers.d.ts +2 -2
- package/dist/util/testHelpers.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-B323CECK.js.map +0 -1
- package/dist/chunk-KBAZ5TWE.js.map +0 -1
- /package/dist/{chunk-Z4G27Y2I.js.map → chunk-HM7VDTDJ.js.map} +0 -0
- /package/dist/{chunk-UXQMGZKP.js.map → chunk-T6YEMFUF.js.map} +0 -0
package/dist/transport/index.cjs
CHANGED
|
@@ -224,7 +224,7 @@ var import_nanoid2 = require("nanoid");
|
|
|
224
224
|
var import_api = require("@opentelemetry/api");
|
|
225
225
|
|
|
226
226
|
// package.json
|
|
227
|
-
var version = "0.23.
|
|
227
|
+
var version = "0.23.11";
|
|
228
228
|
|
|
229
229
|
// tracing/index.ts
|
|
230
230
|
function getPropagationContext(ctx) {
|
|
@@ -498,19 +498,8 @@ var Session = class {
|
|
|
498
498
|
`starting ${this.options.sessionDisconnectGraceMs}ms grace period until session to ${this.to} is closed`,
|
|
499
499
|
this.loggingMetadata
|
|
500
500
|
);
|
|
501
|
-
this.cancelGrace(
|
|
501
|
+
this.cancelGrace();
|
|
502
502
|
this.disconnectionGrace = setTimeout(() => {
|
|
503
|
-
if (this.connection !== void 0) {
|
|
504
|
-
this.log?.warn(
|
|
505
|
-
`grace period for ${this.to} elapsed while connected. not calling callback`,
|
|
506
|
-
{
|
|
507
|
-
...this.loggingMetadata,
|
|
508
|
-
connId: this.connection.id,
|
|
509
|
-
tags: ["invariant-violation"]
|
|
510
|
-
}
|
|
511
|
-
);
|
|
512
|
-
return;
|
|
513
|
-
}
|
|
514
503
|
this.log?.info(
|
|
515
504
|
`grace period for ${this.to} elapsed`,
|
|
516
505
|
this.loggingMetadata
|
|
@@ -519,14 +508,8 @@ var Session = class {
|
|
|
519
508
|
}, this.options.sessionDisconnectGraceMs);
|
|
520
509
|
}
|
|
521
510
|
// called on reconnect of the underlying session
|
|
522
|
-
cancelGrace(
|
|
523
|
-
|
|
524
|
-
}) {
|
|
525
|
-
if (!keepHeartbeatMisses) {
|
|
526
|
-
this.heartbeatMisses = 0;
|
|
527
|
-
}
|
|
528
|
-
if (this.disconnectionGrace === void 0)
|
|
529
|
-
return;
|
|
511
|
+
cancelGrace() {
|
|
512
|
+
this.heartbeatMisses = 0;
|
|
530
513
|
clearTimeout(this.disconnectionGrace);
|
|
531
514
|
this.disconnectionGrace = void 0;
|
|
532
515
|
}
|
|
@@ -787,7 +770,7 @@ var Transport = class {
|
|
|
787
770
|
* and we know the identity of the connected client.
|
|
788
771
|
* @param conn The connection object.
|
|
789
772
|
*/
|
|
790
|
-
onConnect(conn,
|
|
773
|
+
onConnect(conn, session, isReconnect) {
|
|
791
774
|
this.eventDispatcher.dispatchEvent("connectionStatus", {
|
|
792
775
|
status: "connect",
|
|
793
776
|
conn
|
|
@@ -795,13 +778,11 @@ var Transport = class {
|
|
|
795
778
|
conn.telemetry = createConnectionTelemetryInfo(conn, session.telemetry);
|
|
796
779
|
if (isReconnect) {
|
|
797
780
|
session.replaceWithNewConnection(conn);
|
|
798
|
-
this.log?.info(`reconnected to ${connectedTo}`, {
|
|
799
|
-
...conn.loggingMetadata,
|
|
800
|
-
...session.loggingMetadata,
|
|
801
|
-
clientId: this.clientId,
|
|
802
|
-
connectedTo
|
|
803
|
-
});
|
|
804
781
|
}
|
|
782
|
+
this.log?.info(`connected to ${session.to}`, {
|
|
783
|
+
...conn.loggingMetadata,
|
|
784
|
+
...session.loggingMetadata
|
|
785
|
+
});
|
|
805
786
|
}
|
|
806
787
|
createSession(to, conn, propagationCtx) {
|
|
807
788
|
const session = new Session(
|
|
@@ -1132,12 +1113,16 @@ var ClientTransport = class extends Transport {
|
|
|
1132
1113
|
if (session) {
|
|
1133
1114
|
this.onDisconnect(conn, session);
|
|
1134
1115
|
}
|
|
1135
|
-
this.
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1116
|
+
const willReconnect = this.reconnectOnConnectionDrop && this.getStatus() === "open";
|
|
1117
|
+
this.log?.info(
|
|
1118
|
+
`connection to ${to} disconnected` + (willReconnect ? ", reconnecting" : ""),
|
|
1119
|
+
{
|
|
1120
|
+
...conn.loggingMetadata,
|
|
1121
|
+
...session?.loggingMetadata,
|
|
1122
|
+
clientId: this.clientId,
|
|
1123
|
+
connectedTo: to
|
|
1124
|
+
}
|
|
1125
|
+
);
|
|
1141
1126
|
this.inflightConnectionPromises.delete(to);
|
|
1142
1127
|
if (this.reconnectOnConnectionDrop) {
|
|
1143
1128
|
void this.connect(to);
|
|
@@ -1223,8 +1208,8 @@ var ClientTransport = class extends Transport {
|
|
|
1223
1208
|
conn,
|
|
1224
1209
|
sessionId: parsed.payload.status.sessionId
|
|
1225
1210
|
});
|
|
1226
|
-
this.onConnect(conn,
|
|
1227
|
-
this.retryBudget.startRestoringBudget(
|
|
1211
|
+
this.onConnect(conn, session, isReconnect);
|
|
1212
|
+
this.retryBudget.startRestoringBudget(session.to);
|
|
1228
1213
|
return session;
|
|
1229
1214
|
}
|
|
1230
1215
|
/**
|
|
@@ -1232,6 +1217,13 @@ var ClientTransport = class extends Transport {
|
|
|
1232
1217
|
* @param to The client ID of the node to connect to.
|
|
1233
1218
|
*/
|
|
1234
1219
|
async connect(to) {
|
|
1220
|
+
if (this.connections.has(to)) {
|
|
1221
|
+
this.log?.info(`already connected to ${to}, skipping connect attempt`, {
|
|
1222
|
+
clientId: this.clientId,
|
|
1223
|
+
connectedTo: to
|
|
1224
|
+
});
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1235
1227
|
const canProceedWithConnection = () => this.getStatus() === "open";
|
|
1236
1228
|
if (!canProceedWithConnection()) {
|
|
1237
1229
|
this.log?.info(
|
|
@@ -1242,8 +1234,8 @@ var ClientTransport = class extends Transport {
|
|
|
1242
1234
|
}
|
|
1243
1235
|
let reconnectPromise = this.inflightConnectionPromises.get(to);
|
|
1244
1236
|
if (!reconnectPromise) {
|
|
1245
|
-
const budgetConsumed = this.retryBudget.getBudgetConsumed(to);
|
|
1246
1237
|
if (!this.retryBudget.hasBudget(to)) {
|
|
1238
|
+
const budgetConsumed = this.retryBudget.getBudgetConsumed(to);
|
|
1247
1239
|
const errMsg = `tried to connect to ${to} but retry budget exceeded (more than ${budgetConsumed} attempts in the last ${this.retryBudget.totalBudgetRestoreTime}ms)`;
|
|
1248
1240
|
this.log?.error(errMsg, { clientId: this.clientId, connectedTo: to });
|
|
1249
1241
|
this.protocolError(ProtocolError.RetriesExceeded, errMsg);
|
|
@@ -1324,7 +1316,7 @@ var ClientTransport = class extends Transport {
|
|
|
1324
1316
|
clientId: this.clientId,
|
|
1325
1317
|
connectedTo: to
|
|
1326
1318
|
});
|
|
1327
|
-
|
|
1319
|
+
await this.connect(to);
|
|
1328
1320
|
}
|
|
1329
1321
|
}
|
|
1330
1322
|
}
|
|
@@ -1632,7 +1624,7 @@ var ServerTransport = class extends Transport {
|
|
|
1632
1624
|
sessionId: session.id
|
|
1633
1625
|
});
|
|
1634
1626
|
conn.send(this.codec.toBuffer(responseMsg));
|
|
1635
|
-
this.onConnect(conn,
|
|
1627
|
+
this.onConnect(conn, session, isReconnect);
|
|
1636
1628
|
return session;
|
|
1637
1629
|
}
|
|
1638
1630
|
};
|