@replit/river 0.26.5 → 0.26.6
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-IPOUVVKT.js → chunk-3NZ73HXL.js} +12 -7
- package/dist/chunk-3NZ73HXL.js.map +1 -0
- package/dist/{chunk-QEWSUVWV.js → chunk-5INVLQT5.js} +2 -2
- package/dist/{chunk-FA2IRWCM.js → chunk-APGOIQC4.js} +2 -2
- package/dist/{chunk-PZEYFHAB.js → chunk-CER7XNCN.js} +11 -8
- package/dist/chunk-CER7XNCN.js.map +1 -0
- package/dist/{chunk-7KB7DHFZ.js → chunk-H2RVJ32Z.js} +2 -2
- package/dist/{chunk-7KB7DHFZ.js.map → chunk-H2RVJ32Z.js.map} +1 -1
- package/dist/{chunk-XRZ52TYH.js → chunk-H677UET6.js} +15 -7
- package/dist/chunk-H677UET6.js.map +1 -0
- package/dist/{chunk-AZ3ILPXP.js → chunk-J7AQMYUQ.js} +8 -8
- package/dist/chunk-J7AQMYUQ.js.map +1 -0
- package/dist/{chunk-TAH2GVTJ.js → chunk-MZM234IB.js} +1 -1
- package/dist/chunk-MZM234IB.js.map +1 -0
- package/dist/{client-6c67339a.d.ts → client-96810511.d.ts} +2 -2
- package/dist/{connection-03ffb583.d.ts → connection-48133ec3.d.ts} +1 -1
- package/dist/{handshake-154a0bb2.d.ts → handshake-65e0e848.d.ts} +8 -3
- package/dist/logging/index.cjs.map +1 -1
- package/dist/logging/index.d.cts +1 -1
- package/dist/logging/index.d.ts +1 -1
- package/dist/logging/index.js +1 -1
- package/dist/{message-ff78a233.d.ts → message-e917ee98.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 +8 -8
- package/dist/router/index.d.ts +8 -8
- package/dist/router/index.js +2 -2
- package/dist/{server-1f5eb427.d.ts → server-b8aaf116.d.ts} +3 -3
- package/dist/{services-6140f578.d.ts → services-40e7c5cf.d.ts} +3 -3
- package/dist/transport/impls/ws/client.cjs +29 -13
- package/dist/transport/impls/ws/client.cjs.map +1 -1
- package/dist/transport/impls/ws/client.d.cts +4 -4
- package/dist/transport/impls/ws/client.d.ts +4 -4
- package/dist/transport/impls/ws/client.js +6 -6
- package/dist/transport/impls/ws/server.cjs +26 -13
- package/dist/transport/impls/ws/server.cjs.map +1 -1
- package/dist/transport/impls/ws/server.d.cts +4 -4
- package/dist/transport/impls/ws/server.d.ts +4 -4
- package/dist/transport/impls/ws/server.js +6 -6
- package/dist/transport/index.cjs +33 -17
- package/dist/transport/index.cjs.map +1 -1
- package/dist/transport/index.d.cts +4 -4
- package/dist/transport/index.d.ts +4 -4
- package/dist/transport/index.js +6 -6
- package/dist/util/testHelpers.cjs +14 -6
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +4 -4
- package/dist/util/testHelpers.d.ts +4 -4
- package/dist/util/testHelpers.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-AZ3ILPXP.js.map +0 -1
- package/dist/chunk-IPOUVVKT.js.map +0 -1
- package/dist/chunk-PZEYFHAB.js.map +0 -1
- package/dist/chunk-TAH2GVTJ.js.map +0 -1
- package/dist/chunk-XRZ52TYH.js.map +0 -1
- /package/dist/{chunk-QEWSUVWV.js.map → chunk-5INVLQT5.js.map} +0 -0
- /package/dist/{chunk-FA2IRWCM.js.map → chunk-APGOIQC4.js.map} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as TransportClientId } from '../../../message-
|
|
1
|
+
import { c as TransportClientId } from '../../../message-e917ee98.js';
|
|
2
2
|
import { WebSocketServer } from 'ws';
|
|
3
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
3
|
+
import { W as WebSocketConnection } from '../../../connection-48133ec3.js';
|
|
4
4
|
import { W as WsLike } from '../../../wslike-e0b32dd5.js';
|
|
5
|
-
import { S as ServerTransport } from '../../../server-
|
|
6
|
-
import { c as ProvidedServerTransportOptions } from '../../../handshake-
|
|
5
|
+
import { S as ServerTransport } from '../../../server-b8aaf116.js';
|
|
6
|
+
import { c as ProvidedServerTransportOptions } from '../../../handshake-65e0e848.js';
|
|
7
7
|
import '@sinclair/typebox/value';
|
|
8
8
|
import '@sinclair/typebox';
|
|
9
9
|
import '@opentelemetry/api';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as TransportClientId } from '../../../message-
|
|
1
|
+
import { c as TransportClientId } from '../../../message-e917ee98.js';
|
|
2
2
|
import { WebSocketServer } from 'ws';
|
|
3
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
3
|
+
import { W as WebSocketConnection } from '../../../connection-48133ec3.js';
|
|
4
4
|
import { W as WsLike } from '../../../wslike-e0b32dd5.js';
|
|
5
|
-
import { S as ServerTransport } from '../../../server-
|
|
6
|
-
import { c as ProvidedServerTransportOptions } from '../../../handshake-
|
|
5
|
+
import { S as ServerTransport } from '../../../server-b8aaf116.js';
|
|
6
|
+
import { c as ProvidedServerTransportOptions } from '../../../handshake-65e0e848.js';
|
|
7
7
|
import '@sinclair/typebox/value';
|
|
8
8
|
import '@sinclair/typebox';
|
|
9
9
|
import '@opentelemetry/api';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ServerTransport
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-J7AQMYUQ.js";
|
|
4
4
|
import {
|
|
5
5
|
WebSocketConnection
|
|
6
|
-
} from "../../../chunk-
|
|
7
|
-
import "../../../chunk-
|
|
8
|
-
import "../../../chunk-
|
|
9
|
-
import "../../../chunk-
|
|
10
|
-
import "../../../chunk-
|
|
6
|
+
} from "../../../chunk-5INVLQT5.js";
|
|
7
|
+
import "../../../chunk-3NZ73HXL.js";
|
|
8
|
+
import "../../../chunk-MZM234IB.js";
|
|
9
|
+
import "../../../chunk-H677UET6.js";
|
|
10
|
+
import "../../../chunk-H2RVJ32Z.js";
|
|
11
11
|
import "../../../chunk-4PVU7J25.js";
|
|
12
12
|
|
|
13
13
|
// transport/impls/ws/server.ts
|
package/dist/transport/index.cjs
CHANGED
|
@@ -88,7 +88,8 @@ var createLogProxy = (log) => ({
|
|
|
88
88
|
var ProtocolError = {
|
|
89
89
|
RetriesExceeded: "conn_retry_exceeded",
|
|
90
90
|
HandshakeFailed: "handshake_failed",
|
|
91
|
-
MessageOrderingViolated: "message_ordering_violated"
|
|
91
|
+
MessageOrderingViolated: "message_ordering_violated",
|
|
92
|
+
InvalidMessage: "invalid_message"
|
|
92
93
|
};
|
|
93
94
|
var EventDispatcher = class {
|
|
94
95
|
eventListeners = {};
|
|
@@ -596,7 +597,7 @@ var SessionNoConnection = class extends IdentifiedSessionWithGracePeriod {
|
|
|
596
597
|
var import_api = require("@opentelemetry/api");
|
|
597
598
|
|
|
598
599
|
// package.json
|
|
599
|
-
var version = "0.26.
|
|
600
|
+
var version = "0.26.6";
|
|
600
601
|
|
|
601
602
|
// tracing/index.ts
|
|
602
603
|
function getPropagationContext(ctx) {
|
|
@@ -806,6 +807,12 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
806
807
|
}
|
|
807
808
|
});
|
|
808
809
|
}
|
|
810
|
+
closeConnection() {
|
|
811
|
+
this.conn.removeDataListener(this.onMessageData);
|
|
812
|
+
this.conn.removeCloseListener(this.listeners.onConnectionClosed);
|
|
813
|
+
this.conn.removeErrorListener(this.listeners.onConnectionErrored);
|
|
814
|
+
this.conn.close();
|
|
815
|
+
}
|
|
809
816
|
onMessageData = (msg) => {
|
|
810
817
|
const parsedMsg = this.parseMsg(msg);
|
|
811
818
|
if (parsedMsg === null) {
|
|
@@ -822,8 +829,8 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
822
829
|
}
|
|
823
830
|
);
|
|
824
831
|
} else {
|
|
825
|
-
const reason = `received out-of-order msg (got seq: ${parsedMsg.seq}, wanted seq: ${this.ack})`;
|
|
826
|
-
this.log?.
|
|
832
|
+
const reason = `received out-of-order msg, closing connection (got seq: ${parsedMsg.seq}, wanted seq: ${this.ack})`;
|
|
833
|
+
this.log?.warn(reason, {
|
|
827
834
|
...this.loggingMetadata,
|
|
828
835
|
transportMessage: parsedMsg,
|
|
829
836
|
tags: ["invariant-violation"]
|
|
@@ -832,7 +839,7 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
832
839
|
code: import_api2.SpanStatusCode.ERROR,
|
|
833
840
|
message: reason
|
|
834
841
|
});
|
|
835
|
-
this.
|
|
842
|
+
this.closeConnection();
|
|
836
843
|
}
|
|
837
844
|
return;
|
|
838
845
|
}
|
|
@@ -858,8 +865,10 @@ var SessionConnected = class extends IdentifiedSession {
|
|
|
858
865
|
this.conn.removeDataListener(this.onMessageData);
|
|
859
866
|
this.conn.removeCloseListener(this.listeners.onConnectionClosed);
|
|
860
867
|
this.conn.removeErrorListener(this.listeners.onConnectionErrored);
|
|
861
|
-
|
|
862
|
-
|
|
868
|
+
if (this.heartbeatHandle) {
|
|
869
|
+
clearInterval(this.heartbeatHandle);
|
|
870
|
+
this.heartbeatHandle = void 0;
|
|
871
|
+
}
|
|
863
872
|
}
|
|
864
873
|
_handleClose() {
|
|
865
874
|
super._handleClose();
|
|
@@ -1288,8 +1297,12 @@ var Transport = class {
|
|
|
1288
1297
|
return session;
|
|
1289
1298
|
}
|
|
1290
1299
|
// state transitions
|
|
1291
|
-
deleteSession(session) {
|
|
1292
|
-
|
|
1300
|
+
deleteSession(session, options) {
|
|
1301
|
+
const loggingMetadata = session.loggingMetadata;
|
|
1302
|
+
if (loggingMetadata.tags && options?.unhealthy) {
|
|
1303
|
+
loggingMetadata.tags.push("unhealthy-session");
|
|
1304
|
+
}
|
|
1305
|
+
session.log?.info(`closing session ${session.id}`, loggingMetadata);
|
|
1293
1306
|
this.eventDispatcher.dispatchEvent("sessionStatus", {
|
|
1294
1307
|
status: "disconnect",
|
|
1295
1308
|
session
|
|
@@ -1521,7 +1534,7 @@ var ClientTransport = class extends Transport {
|
|
|
1521
1534
|
`invalid handshake: ${reason}`,
|
|
1522
1535
|
handshakingSession.loggingMetadata
|
|
1523
1536
|
);
|
|
1524
|
-
this.deleteSession(session);
|
|
1537
|
+
this.deleteSession(session, { unhealthy: true });
|
|
1525
1538
|
this.protocolError({
|
|
1526
1539
|
type: ProtocolError.HandshakeFailed,
|
|
1527
1540
|
code,
|
|
@@ -1550,7 +1563,7 @@ var ClientTransport = class extends Transport {
|
|
|
1550
1563
|
message: reason
|
|
1551
1564
|
});
|
|
1552
1565
|
this.log?.warn(reason, metadata);
|
|
1553
|
-
this.deleteSession(session);
|
|
1566
|
+
this.deleteSession(session, { unhealthy: true });
|
|
1554
1567
|
}
|
|
1555
1568
|
onHandshakeResponse(session, msg) {
|
|
1556
1569
|
if (!import_value2.Value.Check(ControlMessageHandshakeResponseSchema, msg.payload)) {
|
|
@@ -1615,9 +1628,9 @@ var ClientTransport = class extends Transport {
|
|
|
1615
1628
|
},
|
|
1616
1629
|
onMessage: (msg2) => this.handleMsg(msg2),
|
|
1617
1630
|
onInvalidMessage: (reason) => {
|
|
1618
|
-
this.deleteSession(connectedSession);
|
|
1631
|
+
this.deleteSession(connectedSession, { unhealthy: true });
|
|
1619
1632
|
this.protocolError({
|
|
1620
|
-
type: ProtocolError.
|
|
1633
|
+
type: ProtocolError.InvalidMessage,
|
|
1621
1634
|
message: reason
|
|
1622
1635
|
});
|
|
1623
1636
|
}
|
|
@@ -1729,6 +1742,9 @@ var ClientTransport = class extends Transport {
|
|
|
1729
1742
|
if (this.handshakeExtensions) {
|
|
1730
1743
|
metadata = await this.handshakeExtensions.construct();
|
|
1731
1744
|
}
|
|
1745
|
+
if (session._isConsumed) {
|
|
1746
|
+
return;
|
|
1747
|
+
}
|
|
1732
1748
|
const requestMsg = handshakeRequestMessage({
|
|
1733
1749
|
from: this.clientId,
|
|
1734
1750
|
to: session.to,
|
|
@@ -1811,9 +1827,9 @@ var ServerTransport = class extends Transport {
|
|
|
1811
1827
|
pendingSession.close();
|
|
1812
1828
|
this.pendingSessions.delete(pendingSession);
|
|
1813
1829
|
}
|
|
1814
|
-
deleteSession(session) {
|
|
1830
|
+
deleteSession(session, options) {
|
|
1815
1831
|
this.sessionHandshakeMetadata.delete(session.to);
|
|
1816
|
-
super.deleteSession(session);
|
|
1832
|
+
super.deleteSession(session, options);
|
|
1817
1833
|
}
|
|
1818
1834
|
handleConnection(conn) {
|
|
1819
1835
|
if (this.getStatus() !== "open")
|
|
@@ -2107,10 +2123,10 @@ var ServerTransport = class extends Transport {
|
|
|
2107
2123
|
onMessage: (msg2) => this.handleMsg(msg2),
|
|
2108
2124
|
onInvalidMessage: (reason) => {
|
|
2109
2125
|
this.protocolError({
|
|
2110
|
-
type: ProtocolError.
|
|
2126
|
+
type: ProtocolError.InvalidMessage,
|
|
2111
2127
|
message: reason
|
|
2112
2128
|
});
|
|
2113
|
-
this.deleteSession(connectedSession);
|
|
2129
|
+
this.deleteSession(connectedSession, { unhealthy: true });
|
|
2114
2130
|
}
|
|
2115
2131
|
}
|
|
2116
2132
|
);
|