@replit/river 0.205.1 → 0.205.2
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-HNBYBRJ7.js → chunk-BYA34LH3.js} +2 -2
- package/dist/{chunk-HNBYBRJ7.js.map → chunk-BYA34LH3.js.map} +1 -1
- package/dist/{chunk-356UADV3.js → chunk-FCN2JPOE.js} +2 -2
- package/dist/{chunk-Y2N4EJYG.js → chunk-FTOB2HQN.js} +39 -6
- package/dist/chunk-FTOB2HQN.js.map +1 -0
- package/dist/{chunk-OVLZDQF4.js → chunk-TP4OJAKI.js} +4 -4
- package/dist/{chunk-OVLZDQF4.js.map → chunk-TP4OJAKI.js.map} +1 -1
- package/dist/{chunk-3XCLUGDM.js → chunk-W337YQLT.js} +3 -3
- package/dist/{client-c44d1c69.d.ts → client-8ab60722.d.ts} +1 -1
- package/dist/{connection-03726441.d.ts → connection-8ed39cb5.d.ts} +1 -1
- package/dist/{context-ebf88958.d.ts → context-2c4bb66b.d.ts} +11 -0
- package/dist/router/index.cjs +1 -1
- package/dist/router/index.cjs.map +1 -1
- package/dist/router/index.d.cts +7 -7
- package/dist/router/index.d.ts +7 -7
- package/dist/router/index.js +1 -1
- package/dist/{server-b169b234.d.ts → server-dc261419.d.ts} +1 -1
- package/dist/{services-47b312aa.d.ts → services-036dcc97.d.ts} +2 -2
- package/dist/testUtil/index.cjs +43 -7
- package/dist/testUtil/index.cjs.map +1 -1
- package/dist/testUtil/index.d.cts +4 -4
- package/dist/testUtil/index.d.ts +4 -4
- package/dist/testUtil/index.js +8 -5
- package/dist/testUtil/index.js.map +1 -1
- package/dist/transport/impls/ws/client.cjs +38 -5
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +3 -3
- package/dist/transport/impls/ws/client.d.ts +3 -3
- package/dist/transport/impls/ws/client.js +4 -4
- package/dist/transport/impls/ws/server.cjs +39 -6
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +3 -3
- package/dist/transport/impls/ws/server.d.ts +3 -3
- package/dist/transport/impls/ws/server.js +4 -4
- package/dist/transport/index.cjs +39 -6
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +3 -3
- package/dist/transport/index.d.ts +3 -3
- package/dist/transport/index.js +4 -4
- package/package.json +4 -4
- package/dist/chunk-Y2N4EJYG.js.map +0 -1
- /package/dist/{chunk-356UADV3.js.map → chunk-FCN2JPOE.js.map} +0 -0
- /package/dist/{chunk-3XCLUGDM.js.map → chunk-W337YQLT.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as ClientTransport } from '../../../client-
|
|
1
|
+
import { C as ClientTransport } from '../../../client-8ab60722.js';
|
|
2
2
|
import { c as TransportClientId } from '../../../message-865bba35.js';
|
|
3
|
-
import { b as ProvidedClientTransportOptions } from '../../../context-
|
|
4
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
3
|
+
import { b as ProvidedClientTransportOptions } from '../../../context-2c4bb66b.js';
|
|
4
|
+
import { W as WebSocketConnection } from '../../../connection-8ed39cb5.js';
|
|
5
5
|
import { W as WsLike } from '../../../wslike-e0b32dd5.js';
|
|
6
6
|
import '@sinclair/typebox';
|
|
7
7
|
import '@opentelemetry/api';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as ClientTransport } from '../../../client-
|
|
1
|
+
import { C as ClientTransport } from '../../../client-8ab60722.js';
|
|
2
2
|
import { c as TransportClientId } from '../../../message-865bba35.js';
|
|
3
|
-
import { b as ProvidedClientTransportOptions } from '../../../context-
|
|
4
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
3
|
+
import { b as ProvidedClientTransportOptions } from '../../../context-2c4bb66b.js';
|
|
4
|
+
import { W as WebSocketConnection } from '../../../connection-8ed39cb5.js';
|
|
5
5
|
import { W as WsLike } from '../../../wslike-e0b32dd5.js';
|
|
6
6
|
import '@sinclair/typebox';
|
|
7
7
|
import '@opentelemetry/api';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientTransport
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-W337YQLT.js";
|
|
4
4
|
import {
|
|
5
5
|
WebSocketConnection
|
|
6
|
-
} from "../../../chunk-
|
|
7
|
-
import "../../../chunk-
|
|
8
|
-
import "../../../chunk-
|
|
6
|
+
} from "../../../chunk-FCN2JPOE.js";
|
|
7
|
+
import "../../../chunk-FTOB2HQN.js";
|
|
8
|
+
import "../../../chunk-BYA34LH3.js";
|
|
9
9
|
import "../../../chunk-CC7RN7GI.js";
|
|
10
10
|
import "../../../chunk-AJGIY2UB.js";
|
|
11
11
|
|
|
@@ -560,13 +560,27 @@ var IdentifiedSession = class extends CommonSession {
|
|
|
560
560
|
* Index of the message we will send next (excluding handshake)
|
|
561
561
|
*/
|
|
562
562
|
seq;
|
|
563
|
+
/**
|
|
564
|
+
* Last seq we sent over the wire this session (excluding handshake) and retransmissions
|
|
565
|
+
*/
|
|
566
|
+
seqSent;
|
|
563
567
|
/**
|
|
564
568
|
* Number of unique messages we've received this session (excluding handshake)
|
|
565
569
|
*/
|
|
566
570
|
ack;
|
|
567
571
|
sendBuffer;
|
|
568
572
|
constructor(props) {
|
|
569
|
-
const {
|
|
573
|
+
const {
|
|
574
|
+
id,
|
|
575
|
+
to,
|
|
576
|
+
seq,
|
|
577
|
+
ack,
|
|
578
|
+
sendBuffer,
|
|
579
|
+
telemetry,
|
|
580
|
+
log,
|
|
581
|
+
protocolVersion,
|
|
582
|
+
seqSent: messagesSent
|
|
583
|
+
} = props;
|
|
570
584
|
super(props);
|
|
571
585
|
this.id = id;
|
|
572
586
|
this.to = to;
|
|
@@ -576,6 +590,7 @@ var IdentifiedSession = class extends CommonSession {
|
|
|
576
590
|
this.telemetry = telemetry;
|
|
577
591
|
this.log = log;
|
|
578
592
|
this.protocolVersion = protocolVersion;
|
|
593
|
+
this.seqSent = messagesSent;
|
|
579
594
|
}
|
|
580
595
|
get loggingMetadata() {
|
|
581
596
|
const metadata = {
|
|
@@ -722,7 +737,7 @@ function coerceErrorString(err) {
|
|
|
722
737
|
}
|
|
723
738
|
|
|
724
739
|
// package.json
|
|
725
|
-
var version = "0.205.
|
|
740
|
+
var version = "0.205.2";
|
|
726
741
|
|
|
727
742
|
// tracing/index.ts
|
|
728
743
|
function createSessionTelemetryInfo(tracer, sessionId, to, from, propagationCtx) {
|
|
@@ -878,10 +893,23 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
878
893
|
this.ack = seq + 1;
|
|
879
894
|
this.heartbeatMisses = 0;
|
|
880
895
|
}
|
|
896
|
+
assertSendOrdering(constructedMsg) {
|
|
897
|
+
if (constructedMsg.seq > this.seqSent + 1) {
|
|
898
|
+
const msg = `invariant violation: would have sent out of order msg (seq: ${constructedMsg.seq}, expected: ${this.seqSent} + 1)`;
|
|
899
|
+
this.log?.error(msg, {
|
|
900
|
+
...this.loggingMetadata,
|
|
901
|
+
transportMessage: constructedMsg,
|
|
902
|
+
tags: ["invariant-violation"]
|
|
903
|
+
});
|
|
904
|
+
throw new Error(msg);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
881
907
|
send(msg) {
|
|
882
908
|
const constructedMsg = this.constructMsg(msg);
|
|
909
|
+
this.assertSendOrdering(constructedMsg);
|
|
883
910
|
this.sendBuffer.push(constructedMsg);
|
|
884
911
|
this.conn.send(this.options.codec.toBuffer(constructedMsg));
|
|
912
|
+
this.seqSent = constructedMsg.seq;
|
|
885
913
|
return constructedMsg.id;
|
|
886
914
|
}
|
|
887
915
|
constructor(props) {
|
|
@@ -897,7 +925,9 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
897
925
|
this.loggingMetadata
|
|
898
926
|
);
|
|
899
927
|
for (const msg of this.sendBuffer) {
|
|
928
|
+
this.assertSendOrdering(msg);
|
|
900
929
|
this.conn.send(this.options.codec.toBuffer(msg));
|
|
930
|
+
this.seqSent = msg.seq;
|
|
901
931
|
}
|
|
902
932
|
}
|
|
903
933
|
this.isActivelyHeartbeating = false;
|
|
@@ -963,7 +993,7 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
963
993
|
);
|
|
964
994
|
} else {
|
|
965
995
|
const reason = `received out-of-order msg, closing connection (got seq: ${parsedMsg.seq}, wanted seq: ${this.ack})`;
|
|
966
|
-
this.log?.
|
|
996
|
+
this.log?.error(reason, {
|
|
967
997
|
...this.loggingMetadata,
|
|
968
998
|
transportMessage: parsedMsg,
|
|
969
999
|
tags: ["invariant-violation"]
|
|
@@ -1041,6 +1071,7 @@ function inheritSharedSession(session) {
|
|
|
1041
1071
|
to: session.to,
|
|
1042
1072
|
seq: session.seq,
|
|
1043
1073
|
ack: session.ack,
|
|
1074
|
+
seqSent: session.seqSent,
|
|
1044
1075
|
sendBuffer: session.sendBuffer,
|
|
1045
1076
|
telemetry: session.telemetry,
|
|
1046
1077
|
options: session.options,
|
|
@@ -1068,6 +1099,7 @@ var SessionStateGraph = {
|
|
|
1068
1099
|
to,
|
|
1069
1100
|
seq: 0,
|
|
1070
1101
|
ack: 0,
|
|
1102
|
+
seqSent: 0,
|
|
1071
1103
|
graceExpiryTime: Date.now() + options.sessionDisconnectGraceMs,
|
|
1072
1104
|
sendBuffer,
|
|
1073
1105
|
telemetry,
|
|
@@ -1190,6 +1222,7 @@ var SessionStateGraph = {
|
|
|
1190
1222
|
to,
|
|
1191
1223
|
seq: 0,
|
|
1192
1224
|
ack: 0,
|
|
1225
|
+
seqSent: 0,
|
|
1193
1226
|
sendBuffer: [],
|
|
1194
1227
|
telemetry: createSessionTelemetryInfo(
|
|
1195
1228
|
pendingSession.tracer,
|
|
@@ -1449,7 +1482,7 @@ var Transport = class {
|
|
|
1449
1482
|
});
|
|
1450
1483
|
this.eventDispatcher.dispatchEvent("sessionTransition", {
|
|
1451
1484
|
state: session.state,
|
|
1452
|
-
session
|
|
1485
|
+
id: session.id
|
|
1453
1486
|
});
|
|
1454
1487
|
}
|
|
1455
1488
|
updateSession(session) {
|
|
@@ -1473,7 +1506,7 @@ var Transport = class {
|
|
|
1473
1506
|
this.sessions.set(session.to, session);
|
|
1474
1507
|
this.eventDispatcher.dispatchEvent("sessionTransition", {
|
|
1475
1508
|
state: session.state,
|
|
1476
|
-
session
|
|
1509
|
+
id: session.id
|
|
1477
1510
|
});
|
|
1478
1511
|
}
|
|
1479
1512
|
deleteSession(session, options) {
|
|
@@ -1823,8 +1856,8 @@ var ServerTransport = class extends Transport {
|
|
|
1823
1856
|
}
|
|
1824
1857
|
);
|
|
1825
1858
|
oldSession = noConnectionSession;
|
|
1859
|
+
this.updateSession(oldSession);
|
|
1826
1860
|
}
|
|
1827
|
-
this.updateSession(oldSession);
|
|
1828
1861
|
} else if (oldSession) {
|
|
1829
1862
|
connectCase = "hard reconnection";
|
|
1830
1863
|
this.log?.info(
|