@replit/river 0.17.2 → 0.17.3
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-F6KWMEPR.js → chunk-7WY3Z5ZN.js} +5 -3
- package/dist/{chunk-MSAS5CVJ.js → chunk-F3LFO3GU.js} +1 -1
- package/dist/{chunk-4A7FDC2C.js → chunk-Q7OSVPZ5.js} +1 -1
- package/dist/{connection-0767dc6b.d.ts → connection-713c8c66.d.ts} +1 -1
- package/dist/{connection-f31edbcd.d.ts → connection-b79329de.d.ts} +1 -1
- package/dist/{index-8df0bdfb.d.ts → index-80f87385.d.ts} +1 -0
- package/dist/{procedures-1a298406.d.ts → procedures-79a5f07e.d.ts} +1 -1
- package/dist/router/index.d.cts +3 -3
- package/dist/router/index.d.ts +3 -3
- package/dist/transport/impls/uds/client.cjs +5 -3
- 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 +2 -2
- package/dist/transport/impls/uds/server.cjs +4 -9
- 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 -8
- package/dist/transport/impls/ws/client.cjs +5 -3
- 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 +2 -2
- package/dist/transport/impls/ws/server.cjs +1 -3
- 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 +2 -2
- package/dist/transport/index.cjs +5 -3
- package/dist/transport/index.d.cts +1 -1
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/util/testHelpers.d.cts +2 -2
- package/dist/util/testHelpers.d.ts +2 -2
- package/dist/util/testHelpers.js +1 -1
- package/package.json +2 -2
|
@@ -407,7 +407,6 @@ var Transport = class {
|
|
|
407
407
|
log?.warn(
|
|
408
408
|
`${this.clientId} -- connection from ${connectedTo} is a different session (id: ${advertisedSessionId}, last connected to: ${oldSession.advertisedSessionId}), starting a new session`
|
|
409
409
|
);
|
|
410
|
-
oldSession.close();
|
|
411
410
|
this.deleteSession(oldSession);
|
|
412
411
|
oldSession = void 0;
|
|
413
412
|
}
|
|
@@ -452,6 +451,7 @@ var Transport = class {
|
|
|
452
451
|
return session;
|
|
453
452
|
}
|
|
454
453
|
deleteSession(session) {
|
|
454
|
+
session.close();
|
|
455
455
|
this.sessions.delete(session.to);
|
|
456
456
|
log?.info(
|
|
457
457
|
`${this.clientId} -- session ${session.id} disconnect from ${session.to}`
|
|
@@ -599,7 +599,6 @@ var Transport = class {
|
|
|
599
599
|
close() {
|
|
600
600
|
this.state = "closed";
|
|
601
601
|
for (const session of this.sessions.values()) {
|
|
602
|
-
session.close();
|
|
603
602
|
this.deleteSession(session);
|
|
604
603
|
}
|
|
605
604
|
log?.info(`${this.clientId} -- manually closed transport`);
|
|
@@ -612,7 +611,6 @@ var Transport = class {
|
|
|
612
611
|
destroy() {
|
|
613
612
|
this.state = "destroyed";
|
|
614
613
|
for (const session of this.sessions.values()) {
|
|
615
|
-
session.close();
|
|
616
614
|
this.deleteSession(session);
|
|
617
615
|
}
|
|
618
616
|
log?.info(`${this.clientId} -- manually destroyed transport`);
|
|
@@ -793,6 +791,10 @@ var ClientTransport = class extends Transport {
|
|
|
793
791
|
}
|
|
794
792
|
}
|
|
795
793
|
}
|
|
794
|
+
deleteSession(session) {
|
|
795
|
+
this.inflightConnectionPromises.delete(session.to);
|
|
796
|
+
super.deleteSession(session);
|
|
797
|
+
}
|
|
796
798
|
sendHandshake(to, conn) {
|
|
797
799
|
const session = this.getOrCreateSession(to, conn);
|
|
798
800
|
const requestMsg = handshakeRequestMessage(this.clientId, to, session.id);
|
|
@@ -489,6 +489,7 @@ declare abstract class ClientTransport<ConnType extends Connection> extends Tran
|
|
|
489
489
|
* @param to The client ID of the node to connect to.
|
|
490
490
|
*/
|
|
491
491
|
connect(to: TransportClientId): Promise<void>;
|
|
492
|
+
protected deleteSession(session: Session<ConnType>): void;
|
|
492
493
|
protected sendHandshake(to: TransportClientId, conn: ConnType): void;
|
|
493
494
|
close(): void;
|
|
494
495
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TObject, TUnion, TString, TSchema, TNever, TLiteral, Static } from '@sinclair/typebox';
|
|
2
2
|
import { Pushable } from 'it-pushable';
|
|
3
|
-
import { b as TransportClientId, f as Session, C as Connection } from './index-
|
|
3
|
+
import { b as TransportClientId, f as Session, C as Connection } from './index-80f87385.js';
|
|
4
4
|
|
|
5
5
|
type TLiteralString = TLiteral<string>;
|
|
6
6
|
type RiverErrorSchema = TObject<{
|
package/dist/router/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TUnion, Static } from '@sinclair/typebox';
|
|
2
|
-
import { e as ProcedureMap, P as PayloadType, c as RiverUncaughtSchema, U as Unbranded, B as Branded, A as AnyProcedure, R as RiverError, b as Result, S as ServiceContext } from '../procedures-
|
|
3
|
-
export { E as Err, O as Ok, a as Procedure, d as ProcedureResult, f as RPCProcedure, m as RiverErrorSchema, j as ServiceContextWithState, k as ServiceContextWithTransportInfo, i as StreamProcedure, h as SubscriptionProcedure, l as UNCAUGHT_ERROR, g as UploadProcedure, V as ValidProcType } from '../procedures-
|
|
4
|
-
import { d as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-
|
|
2
|
+
import { e as ProcedureMap, P as PayloadType, c as RiverUncaughtSchema, U as Unbranded, B as Branded, A as AnyProcedure, R as RiverError, b as Result, S as ServiceContext } from '../procedures-79a5f07e.js';
|
|
3
|
+
export { E as Err, O as Ok, a as Procedure, d as ProcedureResult, f as RPCProcedure, m as RiverErrorSchema, j as ServiceContextWithState, k as ServiceContextWithTransportInfo, i as StreamProcedure, h as SubscriptionProcedure, l as UNCAUGHT_ERROR, g as UploadProcedure, V as ValidProcType } from '../procedures-79a5f07e.js';
|
|
4
|
+
import { d as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-80f87385.js';
|
|
5
5
|
import { Pushable } from 'it-pushable';
|
|
6
6
|
import '../types-3e5768ec.js';
|
|
7
7
|
|
package/dist/router/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TUnion, Static } from '@sinclair/typebox';
|
|
2
|
-
import { e as ProcedureMap, P as PayloadType, c as RiverUncaughtSchema, U as Unbranded, B as Branded, A as AnyProcedure, R as RiverError, b as Result, S as ServiceContext } from '../procedures-
|
|
3
|
-
export { E as Err, O as Ok, a as Procedure, d as ProcedureResult, f as RPCProcedure, m as RiverErrorSchema, j as ServiceContextWithState, k as ServiceContextWithTransportInfo, i as StreamProcedure, h as SubscriptionProcedure, l as UNCAUGHT_ERROR, g as UploadProcedure, V as ValidProcType } from '../procedures-
|
|
4
|
-
import { d as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-
|
|
2
|
+
import { e as ProcedureMap, P as PayloadType, c as RiverUncaughtSchema, U as Unbranded, B as Branded, A as AnyProcedure, R as RiverError, b as Result, S as ServiceContext } from '../procedures-79a5f07e.js';
|
|
3
|
+
export { E as Err, O as Ok, a as Procedure, d as ProcedureResult, f as RPCProcedure, m as RiverErrorSchema, j as ServiceContextWithState, k as ServiceContextWithTransportInfo, i as StreamProcedure, h as SubscriptionProcedure, l as UNCAUGHT_ERROR, g as UploadProcedure, V as ValidProcType } from '../procedures-79a5f07e.js';
|
|
4
|
+
import { d as ServerTransport, C as Connection, a as ClientTransport, b as TransportClientId } from '../index-80f87385.js';
|
|
5
5
|
import { Pushable } from 'it-pushable';
|
|
6
6
|
import '../types-3e5768ec.js';
|
|
7
7
|
|
|
@@ -644,7 +644,6 @@ var Transport = class {
|
|
|
644
644
|
log?.warn(
|
|
645
645
|
`${this.clientId} -- connection from ${connectedTo} is a different session (id: ${advertisedSessionId}, last connected to: ${oldSession.advertisedSessionId}), starting a new session`
|
|
646
646
|
);
|
|
647
|
-
oldSession.close();
|
|
648
647
|
this.deleteSession(oldSession);
|
|
649
648
|
oldSession = void 0;
|
|
650
649
|
}
|
|
@@ -689,6 +688,7 @@ var Transport = class {
|
|
|
689
688
|
return session;
|
|
690
689
|
}
|
|
691
690
|
deleteSession(session) {
|
|
691
|
+
session.close();
|
|
692
692
|
this.sessions.delete(session.to);
|
|
693
693
|
log?.info(
|
|
694
694
|
`${this.clientId} -- session ${session.id} disconnect from ${session.to}`
|
|
@@ -836,7 +836,6 @@ var Transport = class {
|
|
|
836
836
|
close() {
|
|
837
837
|
this.state = "closed";
|
|
838
838
|
for (const session of this.sessions.values()) {
|
|
839
|
-
session.close();
|
|
840
839
|
this.deleteSession(session);
|
|
841
840
|
}
|
|
842
841
|
log?.info(`${this.clientId} -- manually closed transport`);
|
|
@@ -849,7 +848,6 @@ var Transport = class {
|
|
|
849
848
|
destroy() {
|
|
850
849
|
this.state = "destroyed";
|
|
851
850
|
for (const session of this.sessions.values()) {
|
|
852
|
-
session.close();
|
|
853
851
|
this.deleteSession(session);
|
|
854
852
|
}
|
|
855
853
|
log?.info(`${this.clientId} -- manually destroyed transport`);
|
|
@@ -1030,6 +1028,10 @@ var ClientTransport = class extends Transport {
|
|
|
1030
1028
|
}
|
|
1031
1029
|
}
|
|
1032
1030
|
}
|
|
1031
|
+
deleteSession(session) {
|
|
1032
|
+
this.inflightConnectionPromises.delete(session.to);
|
|
1033
|
+
super.deleteSession(session);
|
|
1034
|
+
}
|
|
1033
1035
|
sendHandshake(to, conn) {
|
|
1034
1036
|
const session = this.getOrCreateSession(to, conn);
|
|
1035
1037
|
const requestMsg = handshakeRequestMessage(this.clientId, to, session.id);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ClientTransport, c as ProvidedClientTransportOptions, b as TransportClientId } from '../../../index-
|
|
2
|
-
import { U as UdsConnection } from '../../../connection-
|
|
1
|
+
import { a as ClientTransport, c as ProvidedClientTransportOptions, b as TransportClientId } from '../../../index-80f87385.js';
|
|
2
|
+
import { U as UdsConnection } from '../../../connection-713c8c66.js';
|
|
3
3
|
import '../../../types-3e5768ec.js';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import 'node:net';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as ClientTransport, c as ProvidedClientTransportOptions, b as TransportClientId } from '../../../index-
|
|
2
|
-
import { U as UdsConnection } from '../../../connection-
|
|
1
|
+
import { a as ClientTransport, c as ProvidedClientTransportOptions, b as TransportClientId } from '../../../index-80f87385.js';
|
|
2
|
+
import { U as UdsConnection } from '../../../connection-713c8c66.js';
|
|
3
3
|
import '../../../types-3e5768ec.js';
|
|
4
4
|
import '@sinclair/typebox';
|
|
5
5
|
import 'node:net';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UdsConnection
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-Q7OSVPZ5.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-7WY3Z5ZN.js";
|
|
7
7
|
import "../../../chunk-VH3NGOXQ.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
@@ -24,9 +24,6 @@ __export(server_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(server_exports);
|
|
26
26
|
|
|
27
|
-
// logging/index.ts
|
|
28
|
-
var log;
|
|
29
|
-
|
|
30
27
|
// transport/transport.ts
|
|
31
28
|
var import_value = require("@sinclair/typebox/value");
|
|
32
29
|
|
|
@@ -98,6 +95,9 @@ function isAck(controlFlag) {
|
|
|
98
95
|
return (controlFlag & 1 /* AckBit */) === 1 /* AckBit */;
|
|
99
96
|
}
|
|
100
97
|
|
|
98
|
+
// logging/index.ts
|
|
99
|
+
var log;
|
|
100
|
+
|
|
101
101
|
// transport/events.ts
|
|
102
102
|
var ProtocolError = {
|
|
103
103
|
RetriesExceeded: "conn_retry_exceeded",
|
|
@@ -476,7 +476,6 @@ var Transport = class {
|
|
|
476
476
|
log?.warn(
|
|
477
477
|
`${this.clientId} -- connection from ${connectedTo} is a different session (id: ${advertisedSessionId}, last connected to: ${oldSession.advertisedSessionId}), starting a new session`
|
|
478
478
|
);
|
|
479
|
-
oldSession.close();
|
|
480
479
|
this.deleteSession(oldSession);
|
|
481
480
|
oldSession = void 0;
|
|
482
481
|
}
|
|
@@ -521,6 +520,7 @@ var Transport = class {
|
|
|
521
520
|
return session;
|
|
522
521
|
}
|
|
523
522
|
deleteSession(session) {
|
|
523
|
+
session.close();
|
|
524
524
|
this.sessions.delete(session.to);
|
|
525
525
|
log?.info(
|
|
526
526
|
`${this.clientId} -- session ${session.id} disconnect from ${session.to}`
|
|
@@ -668,7 +668,6 @@ var Transport = class {
|
|
|
668
668
|
close() {
|
|
669
669
|
this.state = "closed";
|
|
670
670
|
for (const session of this.sessions.values()) {
|
|
671
|
-
session.close();
|
|
672
671
|
this.deleteSession(session);
|
|
673
672
|
}
|
|
674
673
|
log?.info(`${this.clientId} -- manually closed transport`);
|
|
@@ -681,7 +680,6 @@ var Transport = class {
|
|
|
681
680
|
destroy() {
|
|
682
681
|
this.state = "destroyed";
|
|
683
682
|
for (const session of this.sessions.values()) {
|
|
684
|
-
session.close();
|
|
685
683
|
this.deleteSession(session);
|
|
686
684
|
}
|
|
687
685
|
log?.info(`${this.clientId} -- manually destroyed transport`);
|
|
@@ -887,9 +885,6 @@ var UnixDomainSocketServerTransport = class extends ServerTransport {
|
|
|
887
885
|
super(clientId, providedOptions);
|
|
888
886
|
this.server = server;
|
|
889
887
|
server.addListener("connection", this.connectionHandler);
|
|
890
|
-
server.on("listening", () => {
|
|
891
|
-
log?.info(`${this.clientId} -- server is listening`);
|
|
892
|
-
});
|
|
893
888
|
}
|
|
894
889
|
connectionHandler = (sock) => {
|
|
895
890
|
const conn = new UdsConnection(sock);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Server, Socket } from 'node:net';
|
|
2
|
-
import { d as ServerTransport, b as TransportClientId, e as ProvidedTransportOptions } from '../../../index-
|
|
3
|
-
import { U as UdsConnection } from '../../../connection-
|
|
2
|
+
import { d as ServerTransport, b as TransportClientId, e as ProvidedTransportOptions } from '../../../index-80f87385.js';
|
|
3
|
+
import { U as UdsConnection } from '../../../connection-713c8c66.js';
|
|
4
4
|
import '../../../types-3e5768ec.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
import 'node:stream';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Server, Socket } from 'node:net';
|
|
2
|
-
import { d as ServerTransport, b as TransportClientId, e as ProvidedTransportOptions } from '../../../index-
|
|
3
|
-
import { U as UdsConnection } from '../../../connection-
|
|
2
|
+
import { d as ServerTransport, b as TransportClientId, e as ProvidedTransportOptions } from '../../../index-80f87385.js';
|
|
3
|
+
import { U as UdsConnection } from '../../../connection-713c8c66.js';
|
|
4
4
|
import '../../../types-3e5768ec.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
import 'node:stream';
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UdsConnection
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-Q7OSVPZ5.js";
|
|
4
4
|
import {
|
|
5
5
|
ServerTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-7WY3Z5ZN.js";
|
|
7
7
|
import "../../../chunk-VH3NGOXQ.js";
|
|
8
|
-
import
|
|
9
|
-
log
|
|
10
|
-
} from "../../../chunk-H4BYJELI.js";
|
|
8
|
+
import "../../../chunk-H4BYJELI.js";
|
|
11
9
|
import "../../../chunk-GZ7HCLLM.js";
|
|
12
10
|
|
|
13
11
|
// transport/impls/uds/server.ts
|
|
@@ -17,9 +15,6 @@ var UnixDomainSocketServerTransport = class extends ServerTransport {
|
|
|
17
15
|
super(clientId, providedOptions);
|
|
18
16
|
this.server = server;
|
|
19
17
|
server.addListener("connection", this.connectionHandler);
|
|
20
|
-
server.on("listening", () => {
|
|
21
|
-
log?.info(`${this.clientId} -- server is listening`);
|
|
22
|
-
});
|
|
23
18
|
}
|
|
24
19
|
connectionHandler = (sock) => {
|
|
25
20
|
const conn = new UdsConnection(sock);
|
|
@@ -548,7 +548,6 @@ var Transport = class {
|
|
|
548
548
|
log?.warn(
|
|
549
549
|
`${this.clientId} -- connection from ${connectedTo} is a different session (id: ${advertisedSessionId}, last connected to: ${oldSession.advertisedSessionId}), starting a new session`
|
|
550
550
|
);
|
|
551
|
-
oldSession.close();
|
|
552
551
|
this.deleteSession(oldSession);
|
|
553
552
|
oldSession = void 0;
|
|
554
553
|
}
|
|
@@ -593,6 +592,7 @@ var Transport = class {
|
|
|
593
592
|
return session;
|
|
594
593
|
}
|
|
595
594
|
deleteSession(session) {
|
|
595
|
+
session.close();
|
|
596
596
|
this.sessions.delete(session.to);
|
|
597
597
|
log?.info(
|
|
598
598
|
`${this.clientId} -- session ${session.id} disconnect from ${session.to}`
|
|
@@ -740,7 +740,6 @@ var Transport = class {
|
|
|
740
740
|
close() {
|
|
741
741
|
this.state = "closed";
|
|
742
742
|
for (const session of this.sessions.values()) {
|
|
743
|
-
session.close();
|
|
744
743
|
this.deleteSession(session);
|
|
745
744
|
}
|
|
746
745
|
log?.info(`${this.clientId} -- manually closed transport`);
|
|
@@ -753,7 +752,6 @@ var Transport = class {
|
|
|
753
752
|
destroy() {
|
|
754
753
|
this.state = "destroyed";
|
|
755
754
|
for (const session of this.sessions.values()) {
|
|
756
|
-
session.close();
|
|
757
755
|
this.deleteSession(session);
|
|
758
756
|
}
|
|
759
757
|
log?.info(`${this.clientId} -- manually destroyed transport`);
|
|
@@ -934,6 +932,10 @@ var ClientTransport = class extends Transport {
|
|
|
934
932
|
}
|
|
935
933
|
}
|
|
936
934
|
}
|
|
935
|
+
deleteSession(session) {
|
|
936
|
+
this.inflightConnectionPromises.delete(session.to);
|
|
937
|
+
super.deleteSession(session);
|
|
938
|
+
}
|
|
937
939
|
sendHandshake(to, conn) {
|
|
938
940
|
const session = this.getOrCreateSession(to, conn);
|
|
939
941
|
const requestMsg = handshakeRequestMessage(this.clientId, to, session.id);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocket from 'isomorphic-ws';
|
|
2
|
-
import { a as ClientTransport, b as TransportClientId, c as ProvidedClientTransportOptions } from '../../../index-
|
|
3
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
2
|
+
import { a as ClientTransport, b as TransportClientId, c as ProvidedClientTransportOptions } from '../../../index-80f87385.js';
|
|
3
|
+
import { W as WebSocketConnection } from '../../../connection-b79329de.js';
|
|
4
4
|
import '../../../types-3e5768ec.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocket from 'isomorphic-ws';
|
|
2
|
-
import { a as ClientTransport, b as TransportClientId, c as ProvidedClientTransportOptions } from '../../../index-
|
|
3
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
2
|
+
import { a as ClientTransport, b as TransportClientId, c as ProvidedClientTransportOptions } from '../../../index-80f87385.js';
|
|
3
|
+
import { W as WebSocketConnection } from '../../../connection-b79329de.js';
|
|
4
4
|
import '../../../types-3e5768ec.js';
|
|
5
5
|
import '@sinclair/typebox';
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WebSocketConnection
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-F3LFO3GU.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-7WY3Z5ZN.js";
|
|
7
7
|
import "../../../chunk-VH3NGOXQ.js";
|
|
8
8
|
import {
|
|
9
9
|
log
|
|
@@ -476,7 +476,6 @@ var Transport = class {
|
|
|
476
476
|
log?.warn(
|
|
477
477
|
`${this.clientId} -- connection from ${connectedTo} is a different session (id: ${advertisedSessionId}, last connected to: ${oldSession.advertisedSessionId}), starting a new session`
|
|
478
478
|
);
|
|
479
|
-
oldSession.close();
|
|
480
479
|
this.deleteSession(oldSession);
|
|
481
480
|
oldSession = void 0;
|
|
482
481
|
}
|
|
@@ -521,6 +520,7 @@ var Transport = class {
|
|
|
521
520
|
return session;
|
|
522
521
|
}
|
|
523
522
|
deleteSession(session) {
|
|
523
|
+
session.close();
|
|
524
524
|
this.sessions.delete(session.to);
|
|
525
525
|
log?.info(
|
|
526
526
|
`${this.clientId} -- session ${session.id} disconnect from ${session.to}`
|
|
@@ -668,7 +668,6 @@ var Transport = class {
|
|
|
668
668
|
close() {
|
|
669
669
|
this.state = "closed";
|
|
670
670
|
for (const session of this.sessions.values()) {
|
|
671
|
-
session.close();
|
|
672
671
|
this.deleteSession(session);
|
|
673
672
|
}
|
|
674
673
|
log?.info(`${this.clientId} -- manually closed transport`);
|
|
@@ -681,7 +680,6 @@ var Transport = class {
|
|
|
681
680
|
destroy() {
|
|
682
681
|
this.state = "destroyed";
|
|
683
682
|
for (const session of this.sessions.values()) {
|
|
684
|
-
session.close();
|
|
685
683
|
this.deleteSession(session);
|
|
686
684
|
}
|
|
687
685
|
log?.info(`${this.clientId} -- manually destroyed transport`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as ServerTransport, b as TransportClientId, e as ProvidedTransportOptions } from '../../../index-
|
|
1
|
+
import { d as ServerTransport, b as TransportClientId, e as ProvidedTransportOptions } from '../../../index-80f87385.js';
|
|
2
2
|
import { WebSocketServer } from 'ws';
|
|
3
3
|
import { WebSocket } from 'isomorphic-ws';
|
|
4
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
4
|
+
import { W as WebSocketConnection } from '../../../connection-b79329de.js';
|
|
5
5
|
import '../../../types-3e5768ec.js';
|
|
6
6
|
import '@sinclair/typebox';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as ServerTransport, b as TransportClientId, e as ProvidedTransportOptions } from '../../../index-
|
|
1
|
+
import { d as ServerTransport, b as TransportClientId, e as ProvidedTransportOptions } from '../../../index-80f87385.js';
|
|
2
2
|
import { WebSocketServer } from 'ws';
|
|
3
3
|
import { WebSocket } from 'isomorphic-ws';
|
|
4
|
-
import { W as WebSocketConnection } from '../../../connection-
|
|
4
|
+
import { W as WebSocketConnection } from '../../../connection-b79329de.js';
|
|
5
5
|
import '../../../types-3e5768ec.js';
|
|
6
6
|
import '@sinclair/typebox';
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WebSocketConnection
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-F3LFO3GU.js";
|
|
4
4
|
import {
|
|
5
5
|
ServerTransport
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-7WY3Z5ZN.js";
|
|
7
7
|
import "../../../chunk-VH3NGOXQ.js";
|
|
8
8
|
import "../../../chunk-H4BYJELI.js";
|
|
9
9
|
import "../../../chunk-GZ7HCLLM.js";
|
package/dist/transport/index.cjs
CHANGED
|
@@ -570,7 +570,6 @@ var Transport = class {
|
|
|
570
570
|
log?.warn(
|
|
571
571
|
`${this.clientId} -- connection from ${connectedTo} is a different session (id: ${advertisedSessionId}, last connected to: ${oldSession.advertisedSessionId}), starting a new session`
|
|
572
572
|
);
|
|
573
|
-
oldSession.close();
|
|
574
573
|
this.deleteSession(oldSession);
|
|
575
574
|
oldSession = void 0;
|
|
576
575
|
}
|
|
@@ -615,6 +614,7 @@ var Transport = class {
|
|
|
615
614
|
return session;
|
|
616
615
|
}
|
|
617
616
|
deleteSession(session) {
|
|
617
|
+
session.close();
|
|
618
618
|
this.sessions.delete(session.to);
|
|
619
619
|
log?.info(
|
|
620
620
|
`${this.clientId} -- session ${session.id} disconnect from ${session.to}`
|
|
@@ -762,7 +762,6 @@ var Transport = class {
|
|
|
762
762
|
close() {
|
|
763
763
|
this.state = "closed";
|
|
764
764
|
for (const session of this.sessions.values()) {
|
|
765
|
-
session.close();
|
|
766
765
|
this.deleteSession(session);
|
|
767
766
|
}
|
|
768
767
|
log?.info(`${this.clientId} -- manually closed transport`);
|
|
@@ -775,7 +774,6 @@ var Transport = class {
|
|
|
775
774
|
destroy() {
|
|
776
775
|
this.state = "destroyed";
|
|
777
776
|
for (const session of this.sessions.values()) {
|
|
778
|
-
session.close();
|
|
779
777
|
this.deleteSession(session);
|
|
780
778
|
}
|
|
781
779
|
log?.info(`${this.clientId} -- manually destroyed transport`);
|
|
@@ -956,6 +954,10 @@ var ClientTransport = class extends Transport {
|
|
|
956
954
|
}
|
|
957
955
|
}
|
|
958
956
|
}
|
|
957
|
+
deleteSession(session) {
|
|
958
|
+
this.inflightConnectionPromises.delete(session.to);
|
|
959
|
+
super.deleteSession(session);
|
|
960
|
+
}
|
|
959
961
|
sendHandshake(to, conn) {
|
|
960
962
|
const session = this.getOrCreateSession(to, conn);
|
|
961
963
|
const requestMsg = handshakeRequestMessage(this.clientId, to, session.id);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { a as ClientTransport, c as ClientTransportOptions, C as Connection, n as EventHandler, E as EventMap, m as EventTypes, O as OpaqueTransportMessage, i as OpaqueTransportMessageSchema, o as ProtocolError, p as ProtocolErrorType, d as ServerTransport, f as Session, T as Transport, b as TransportClientId, j as TransportMessage, h as TransportMessageSchema, e as TransportOptions, g as TransportStatus, l as isStreamClose, k as isStreamOpen } from '../index-
|
|
1
|
+
export { a as ClientTransport, c as ClientTransportOptions, C as Connection, n as EventHandler, E as EventMap, m as EventTypes, O as OpaqueTransportMessage, i as OpaqueTransportMessageSchema, o as ProtocolError, p as ProtocolErrorType, d as ServerTransport, f as Session, T as Transport, b as TransportClientId, j as TransportMessage, h as TransportMessageSchema, e as TransportOptions, g as TransportStatus, l as isStreamClose, k as isStreamOpen } from '../index-80f87385.js';
|
|
2
2
|
import '../types-3e5768ec.js';
|
|
3
3
|
import '@sinclair/typebox';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { a as ClientTransport, c as ClientTransportOptions, C as Connection, n as EventHandler, E as EventMap, m as EventTypes, O as OpaqueTransportMessage, i as OpaqueTransportMessageSchema, o as ProtocolError, p as ProtocolErrorType, d as ServerTransport, f as Session, T as Transport, b as TransportClientId, j as TransportMessage, h as TransportMessageSchema, e as TransportOptions, g as TransportStatus, l as isStreamClose, k as isStreamOpen } from '../index-
|
|
1
|
+
export { a as ClientTransport, c as ClientTransportOptions, C as Connection, n as EventHandler, E as EventMap, m as EventTypes, O as OpaqueTransportMessage, i as OpaqueTransportMessageSchema, o as ProtocolError, p as ProtocolErrorType, d as ServerTransport, f as Session, T as Transport, b as TransportClientId, j as TransportMessage, h as TransportMessageSchema, e as TransportOptions, g as TransportStatus, l as isStreamClose, k as isStreamOpen } from '../index-80f87385.js';
|
|
2
2
|
import '../types-3e5768ec.js';
|
|
3
3
|
import '@sinclair/typebox';
|
package/dist/transport/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Static } from '@sinclair/typebox';
|
|
2
|
-
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-
|
|
3
|
-
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage, S as SessionOptions } from '../index-
|
|
2
|
+
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-79a5f07e.js';
|
|
3
|
+
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage, S as SessionOptions } from '../index-80f87385.js';
|
|
4
4
|
import * as it_pushable from 'it-pushable';
|
|
5
5
|
import WebSocket from 'isomorphic-ws';
|
|
6
6
|
import http from 'node:http';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Static } from '@sinclair/typebox';
|
|
2
|
-
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-
|
|
3
|
-
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage, S as SessionOptions } from '../index-
|
|
2
|
+
import { P as PayloadType, R as RiverError, a as Procedure, S as ServiceContext, b as Result, c as RiverUncaughtSchema, d as ProcedureResult } from '../procedures-79a5f07e.js';
|
|
3
|
+
import { P as PartialTransportMessage, T as Transport, C as Connection, O as OpaqueTransportMessage, S as SessionOptions } from '../index-80f87385.js';
|
|
4
4
|
import * as it_pushable from 'it-pushable';
|
|
5
5
|
import WebSocket from 'isomorphic-ws';
|
|
6
6
|
import http from 'node:http';
|
package/dist/util/testHelpers.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replit/river",
|
|
3
3
|
"description": "It's like tRPC but... with JSON Schema Support, duplex streaming and support for service multiplexing. Transport agnostic!",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"release": "npm publish --access public",
|
|
83
83
|
"test:ui": "echo \"remember to go to /__vitest__ in the webview\" && vitest --ui --api.host 0.0.0.0 --api.port 3000",
|
|
84
84
|
"test": "vitest --test-timeout=500",
|
|
85
|
-
"test:single": "vitest run --test-timeout=500",
|
|
85
|
+
"test:single": "vitest run --test-timeout=500 --reporter=dot",
|
|
86
86
|
"test:flake": "./flake.sh",
|
|
87
87
|
"bench": "vitest bench"
|
|
88
88
|
},
|