@replit/river 0.23.11 → 0.23.12
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-MEHCOYKJ.js → chunk-7RUKEUKE.js} +2 -2
- package/dist/{chunk-MEHCOYKJ.js.map → chunk-7RUKEUKE.js.map} +1 -1
- package/dist/{chunk-T6YEMFUF.js → chunk-H6KTH6W6.js} +2 -2
- package/dist/{chunk-HM7VDTDJ.js → chunk-HDBVL7EF.js} +2 -2
- package/dist/{chunk-EOJMKMDO.js → chunk-VRU4IKRT.js} +35 -15
- package/dist/chunk-VRU4IKRT.js.map +1 -0
- package/dist/{chunk-ZSKCZYVU.js → chunk-XZ6IOBM5.js} +2 -2
- package/dist/{connection-c1eeb95d.d.ts → connection-581558f8.d.ts} +1 -1
- package/dist/{connection-261eee8f.d.ts → connection-8debd45f.d.ts} +1 -1
- package/dist/router/index.cjs +1 -1
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +5 -5
- package/dist/router/index.d.ts +5 -5
- package/dist/router/index.js +2 -2
- package/dist/{services-524bab79.d.ts → services-ca72c9f8.d.ts} +1 -1
- package/dist/transport/impls/uds/client.cjs +32 -12
- 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 +13 -12
- 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 +32 -12
- 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 +13 -12
- 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 +34 -14
- 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-c8f36f6d.d.ts → transport-47af1c81.d.ts} +3 -2
- package/dist/util/testHelpers.cjs +5 -3
- 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-EOJMKMDO.js.map +0 -1
- /package/dist/{chunk-T6YEMFUF.js.map → chunk-H6KTH6W6.js.map} +0 -0
- /package/dist/{chunk-HM7VDTDJ.js.map → chunk-HDBVL7EF.js.map} +0 -0
- /package/dist/{chunk-ZSKCZYVU.js.map → chunk-XZ6IOBM5.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WebSocketConnection
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-HDBVL7EF.js";
|
|
4
4
|
import {
|
|
5
5
|
ServerTransport
|
|
6
|
-
} from "../../../chunk-
|
|
7
|
-
import "../../../chunk-
|
|
6
|
+
} from "../../../chunk-VRU4IKRT.js";
|
|
7
|
+
import "../../../chunk-7RUKEUKE.js";
|
|
8
8
|
import "../../../chunk-6LCL2ZZF.js";
|
|
9
9
|
import "../../../chunk-3AW3IXVD.js";
|
|
10
10
|
|
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.12";
|
|
228
228
|
|
|
229
229
|
// tracing/index.ts
|
|
230
230
|
function getPropagationContext(ctx) {
|
|
@@ -483,10 +483,12 @@ var Session = class {
|
|
|
483
483
|
this.connection.close();
|
|
484
484
|
this.connection = void 0;
|
|
485
485
|
}
|
|
486
|
-
replaceWithNewConnection(newConn) {
|
|
486
|
+
replaceWithNewConnection(newConn, isTransparentReconnect) {
|
|
487
487
|
this.closeStaleConnection(newConn);
|
|
488
488
|
this.cancelGrace();
|
|
489
|
-
|
|
489
|
+
if (isTransparentReconnect) {
|
|
490
|
+
this.sendBufferedMessages(newConn);
|
|
491
|
+
}
|
|
490
492
|
this.connection = newConn;
|
|
491
493
|
this.handshakingConnection = void 0;
|
|
492
494
|
}
|
|
@@ -770,15 +772,13 @@ var Transport = class {
|
|
|
770
772
|
* and we know the identity of the connected client.
|
|
771
773
|
* @param conn The connection object.
|
|
772
774
|
*/
|
|
773
|
-
onConnect(conn, session,
|
|
775
|
+
onConnect(conn, session, isTransparentReconnect) {
|
|
774
776
|
this.eventDispatcher.dispatchEvent("connectionStatus", {
|
|
775
777
|
status: "connect",
|
|
776
778
|
conn
|
|
777
779
|
});
|
|
778
780
|
conn.telemetry = createConnectionTelemetryInfo(conn, session.telemetry);
|
|
779
|
-
|
|
780
|
-
session.replaceWithNewConnection(conn);
|
|
781
|
-
}
|
|
781
|
+
session.replaceWithNewConnection(conn, isTransparentReconnect);
|
|
782
782
|
this.log?.info(`connected to ${session.to}`, {
|
|
783
783
|
...conn.loggingMetadata,
|
|
784
784
|
...session.loggingMetadata
|
|
@@ -810,7 +810,8 @@ var Transport = class {
|
|
|
810
810
|
propagationCtx
|
|
811
811
|
}) {
|
|
812
812
|
let session = this.sessions.get(to);
|
|
813
|
-
|
|
813
|
+
const isReconnect = session !== void 0;
|
|
814
|
+
let isTransparentReconnect = isReconnect;
|
|
814
815
|
if (session?.advertisedSessionId !== void 0 && sessionId !== void 0 && session.advertisedSessionId !== sessionId) {
|
|
815
816
|
this.log?.info(
|
|
816
817
|
`session for ${to} already exists but has a different session id (expected: ${session.advertisedSessionId}, got: ${sessionId}), creating a new one`,
|
|
@@ -821,7 +822,7 @@ var Transport = class {
|
|
|
821
822
|
closeHandshakingConnection: handshakingConn !== void 0,
|
|
822
823
|
handshakingConn
|
|
823
824
|
});
|
|
824
|
-
|
|
825
|
+
isTransparentReconnect = false;
|
|
825
826
|
session = void 0;
|
|
826
827
|
}
|
|
827
828
|
if (!session) {
|
|
@@ -837,7 +838,7 @@ var Transport = class {
|
|
|
837
838
|
if (handshakingConn !== void 0) {
|
|
838
839
|
session.replaceWithNewHandshakingConnection(handshakingConn);
|
|
839
840
|
}
|
|
840
|
-
return { session, isReconnect };
|
|
841
|
+
return { session, isReconnect, isTransparentReconnect };
|
|
841
842
|
}
|
|
842
843
|
deleteSession({
|
|
843
844
|
session,
|
|
@@ -1197,18 +1198,37 @@ var ClientTransport = class extends Transport {
|
|
|
1197
1198
|
);
|
|
1198
1199
|
return false;
|
|
1199
1200
|
}
|
|
1201
|
+
const previousSession = this.sessions.get(parsed.from);
|
|
1202
|
+
if (previousSession?.advertisedSessionId && previousSession.advertisedSessionId !== parsed.payload.status.sessionId) {
|
|
1203
|
+
this.deleteSession({
|
|
1204
|
+
session: previousSession,
|
|
1205
|
+
closeHandshakingConnection: true
|
|
1206
|
+
});
|
|
1207
|
+
conn.telemetry?.span.setStatus({
|
|
1208
|
+
code: import_api3.SpanStatusCode.ERROR,
|
|
1209
|
+
message: "session id mismatch"
|
|
1210
|
+
});
|
|
1211
|
+
this.log?.warn(`handshake from ${parsed.from} session id mismatch`, {
|
|
1212
|
+
...conn.loggingMetadata,
|
|
1213
|
+
clientId: this.clientId,
|
|
1214
|
+
connectedTo: parsed.from,
|
|
1215
|
+
transportMessage: parsed
|
|
1216
|
+
});
|
|
1217
|
+
this.protocolError(ProtocolError.HandshakeFailed, "session id mismatch");
|
|
1218
|
+
return false;
|
|
1219
|
+
}
|
|
1200
1220
|
this.log?.debug(`handshake from ${parsed.from} ok`, {
|
|
1201
1221
|
...conn.loggingMetadata,
|
|
1202
1222
|
clientId: this.clientId,
|
|
1203
1223
|
connectedTo: parsed.from,
|
|
1204
1224
|
transportMessage: parsed
|
|
1205
1225
|
});
|
|
1206
|
-
const { session,
|
|
1226
|
+
const { session, isTransparentReconnect } = this.getOrCreateSession({
|
|
1207
1227
|
to: parsed.from,
|
|
1208
1228
|
conn,
|
|
1209
1229
|
sessionId: parsed.payload.status.sessionId
|
|
1210
1230
|
});
|
|
1211
|
-
this.onConnect(conn, session,
|
|
1231
|
+
this.onConnect(conn, session, isTransparentReconnect);
|
|
1212
1232
|
this.retryBudget.startRestoringBudget(session.to);
|
|
1213
1233
|
return session;
|
|
1214
1234
|
}
|
|
@@ -1608,7 +1628,7 @@ var ServerTransport = class extends Transport {
|
|
|
1608
1628
|
if (parsedMetadata === false) {
|
|
1609
1629
|
return false;
|
|
1610
1630
|
}
|
|
1611
|
-
const { session,
|
|
1631
|
+
const { session, isTransparentReconnect } = this.getOrCreateSession({
|
|
1612
1632
|
to: parsed.from,
|
|
1613
1633
|
conn,
|
|
1614
1634
|
sessionId: parsed.payload.sessionId,
|
|
@@ -1624,7 +1644,7 @@ var ServerTransport = class extends Transport {
|
|
|
1624
1644
|
sessionId: session.id
|
|
1625
1645
|
});
|
|
1626
1646
|
conn.send(this.codec.toBuffer(responseMsg));
|
|
1627
|
-
this.onConnect(conn, session,
|
|
1647
|
+
this.onConnect(conn, session, isTransparentReconnect);
|
|
1628
1648
|
return session;
|
|
1629
1649
|
}
|
|
1630
1650
|
};
|