@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,7 +1,7 @@
|
|
|
1
1
|
import { Server, Socket } from 'node:net';
|
|
2
|
-
import { d as ServerTransport, e as ProvidedServerTransportOptions } from '../../../transport-
|
|
2
|
+
import { d as ServerTransport, e as ProvidedServerTransportOptions } from '../../../transport-47af1c81.js';
|
|
3
3
|
import { T as TransportClientId } from '../../../index-60f03cb7.js';
|
|
4
|
-
import { U as UdsConnection } from '../../../connection-
|
|
4
|
+
import { U as UdsConnection } from '../../../connection-581558f8.js';
|
|
5
5
|
import '../../../types-3e5768ec.js';
|
|
6
6
|
import '@sinclair/typebox';
|
|
7
7
|
import '@sinclair/typebox/value';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UdsConnection
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-H6KTH6W6.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
|
|
|
@@ -202,7 +202,7 @@ var import_nanoid2 = require("nanoid");
|
|
|
202
202
|
var import_api = require("@opentelemetry/api");
|
|
203
203
|
|
|
204
204
|
// package.json
|
|
205
|
-
var version = "0.23.
|
|
205
|
+
var version = "0.23.12";
|
|
206
206
|
|
|
207
207
|
// tracing/index.ts
|
|
208
208
|
function getPropagationContext(ctx) {
|
|
@@ -461,10 +461,12 @@ var Session = class {
|
|
|
461
461
|
this.connection.close();
|
|
462
462
|
this.connection = void 0;
|
|
463
463
|
}
|
|
464
|
-
replaceWithNewConnection(newConn) {
|
|
464
|
+
replaceWithNewConnection(newConn, isTransparentReconnect) {
|
|
465
465
|
this.closeStaleConnection(newConn);
|
|
466
466
|
this.cancelGrace();
|
|
467
|
-
|
|
467
|
+
if (isTransparentReconnect) {
|
|
468
|
+
this.sendBufferedMessages(newConn);
|
|
469
|
+
}
|
|
468
470
|
this.connection = newConn;
|
|
469
471
|
this.handshakingConnection = void 0;
|
|
470
472
|
}
|
|
@@ -748,15 +750,13 @@ var Transport = class {
|
|
|
748
750
|
* and we know the identity of the connected client.
|
|
749
751
|
* @param conn The connection object.
|
|
750
752
|
*/
|
|
751
|
-
onConnect(conn, session,
|
|
753
|
+
onConnect(conn, session, isTransparentReconnect) {
|
|
752
754
|
this.eventDispatcher.dispatchEvent("connectionStatus", {
|
|
753
755
|
status: "connect",
|
|
754
756
|
conn
|
|
755
757
|
});
|
|
756
758
|
conn.telemetry = createConnectionTelemetryInfo(conn, session.telemetry);
|
|
757
|
-
|
|
758
|
-
session.replaceWithNewConnection(conn);
|
|
759
|
-
}
|
|
759
|
+
session.replaceWithNewConnection(conn, isTransparentReconnect);
|
|
760
760
|
this.log?.info(`connected to ${session.to}`, {
|
|
761
761
|
...conn.loggingMetadata,
|
|
762
762
|
...session.loggingMetadata
|
|
@@ -788,7 +788,8 @@ var Transport = class {
|
|
|
788
788
|
propagationCtx
|
|
789
789
|
}) {
|
|
790
790
|
let session = this.sessions.get(to);
|
|
791
|
-
|
|
791
|
+
const isReconnect = session !== void 0;
|
|
792
|
+
let isTransparentReconnect = isReconnect;
|
|
792
793
|
if (session?.advertisedSessionId !== void 0 && sessionId !== void 0 && session.advertisedSessionId !== sessionId) {
|
|
793
794
|
this.log?.info(
|
|
794
795
|
`session for ${to} already exists but has a different session id (expected: ${session.advertisedSessionId}, got: ${sessionId}), creating a new one`,
|
|
@@ -799,7 +800,7 @@ var Transport = class {
|
|
|
799
800
|
closeHandshakingConnection: handshakingConn !== void 0,
|
|
800
801
|
handshakingConn
|
|
801
802
|
});
|
|
802
|
-
|
|
803
|
+
isTransparentReconnect = false;
|
|
803
804
|
session = void 0;
|
|
804
805
|
}
|
|
805
806
|
if (!session) {
|
|
@@ -815,7 +816,7 @@ var Transport = class {
|
|
|
815
816
|
if (handshakingConn !== void 0) {
|
|
816
817
|
session.replaceWithNewHandshakingConnection(handshakingConn);
|
|
817
818
|
}
|
|
818
|
-
return { session, isReconnect };
|
|
819
|
+
return { session, isReconnect, isTransparentReconnect };
|
|
819
820
|
}
|
|
820
821
|
deleteSession({
|
|
821
822
|
session,
|
|
@@ -1175,18 +1176,37 @@ var ClientTransport = class extends Transport {
|
|
|
1175
1176
|
);
|
|
1176
1177
|
return false;
|
|
1177
1178
|
}
|
|
1179
|
+
const previousSession = this.sessions.get(parsed.from);
|
|
1180
|
+
if (previousSession?.advertisedSessionId && previousSession.advertisedSessionId !== parsed.payload.status.sessionId) {
|
|
1181
|
+
this.deleteSession({
|
|
1182
|
+
session: previousSession,
|
|
1183
|
+
closeHandshakingConnection: true
|
|
1184
|
+
});
|
|
1185
|
+
conn.telemetry?.span.setStatus({
|
|
1186
|
+
code: import_api3.SpanStatusCode.ERROR,
|
|
1187
|
+
message: "session id mismatch"
|
|
1188
|
+
});
|
|
1189
|
+
this.log?.warn(`handshake from ${parsed.from} session id mismatch`, {
|
|
1190
|
+
...conn.loggingMetadata,
|
|
1191
|
+
clientId: this.clientId,
|
|
1192
|
+
connectedTo: parsed.from,
|
|
1193
|
+
transportMessage: parsed
|
|
1194
|
+
});
|
|
1195
|
+
this.protocolError(ProtocolError.HandshakeFailed, "session id mismatch");
|
|
1196
|
+
return false;
|
|
1197
|
+
}
|
|
1178
1198
|
this.log?.debug(`handshake from ${parsed.from} ok`, {
|
|
1179
1199
|
...conn.loggingMetadata,
|
|
1180
1200
|
clientId: this.clientId,
|
|
1181
1201
|
connectedTo: parsed.from,
|
|
1182
1202
|
transportMessage: parsed
|
|
1183
1203
|
});
|
|
1184
|
-
const { session,
|
|
1204
|
+
const { session, isTransparentReconnect } = this.getOrCreateSession({
|
|
1185
1205
|
to: parsed.from,
|
|
1186
1206
|
conn,
|
|
1187
1207
|
sessionId: parsed.payload.status.sessionId
|
|
1188
1208
|
});
|
|
1189
|
-
this.onConnect(conn, session,
|
|
1209
|
+
this.onConnect(conn, session, isTransparentReconnect);
|
|
1190
1210
|
this.retryBudget.startRestoringBudget(session.to);
|
|
1191
1211
|
return session;
|
|
1192
1212
|
}
|