@replit/river 0.23.14 → 0.23.16
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-D2DHRRBN.js → chunk-JA7XGTAL.js} +4 -4
- package/dist/{chunk-GN4YEXT7.js → chunk-LTSLICON.js} +2 -2
- package/dist/{chunk-WUL63FR6.js → chunk-MQCGG6KL.js} +4 -4
- package/dist/{chunk-BEALFLCB.js → chunk-R47IZD67.js} +2 -2
- package/dist/{chunk-GCCRVSMR.js → chunk-TXSQRTZB.js} +2 -2
- package/dist/{chunk-GCCRVSMR.js.map → chunk-TXSQRTZB.js.map} +1 -1
- package/dist/{chunk-YCLZWES2.js → chunk-UDXM64QK.js} +2 -2
- package/dist/{chunk-OTVTKAN6.js → chunk-WN77AT67.js} +29 -4
- package/dist/chunk-WN77AT67.js.map +1 -0
- package/dist/{chunk-O2AVDJCQ.js → chunk-YXDAOVP7.js} +14 -2
- package/dist/{chunk-O2AVDJCQ.js.map → chunk-YXDAOVP7.js.map} +1 -1
- package/dist/{client-e13979ac.d.ts → client-0926d3d6.d.ts} +1 -1
- package/dist/{connection-e57e98ea.d.ts → connection-99a67d3e.d.ts} +1 -1
- package/dist/{connection-5d0978ce.d.ts → connection-d738cc08.d.ts} +1 -1
- package/dist/{handshake-5665ffd3.d.ts → handshake-75d0124f.d.ts} +5 -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 +2 -2
- package/dist/{server-1cfc88d1.d.ts → server-3740c5d9.d.ts} +1 -1
- package/dist/{services-86c4d10d.d.ts → services-75e84a9f.d.ts} +2 -2
- package/dist/transport/impls/uds/client.cjs +39 -2
- package/dist/transport/impls/uds/client.cjs.map +1 -1
- package/dist/transport/impls/uds/client.d.cts +3 -3
- package/dist/transport/impls/uds/client.d.ts +3 -3
- package/dist/transport/impls/uds/client.js +5 -5
- package/dist/transport/impls/uds/server.cjs +39 -2
- package/dist/transport/impls/uds/server.cjs.map +1 -1
- package/dist/transport/impls/uds/server.d.cts +3 -3
- package/dist/transport/impls/uds/server.d.ts +3 -3
- package/dist/transport/impls/uds/server.js +5 -5
- package/dist/transport/impls/ws/client.cjs +39 -2
- 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 +5 -5
- package/dist/transport/impls/ws/server.cjs +39 -2
- 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 +5 -5
- package/dist/transport/index.cjs +39 -2
- 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 +5 -5
- package/dist/util/testHelpers.cjs +13 -1
- package/dist/util/testHelpers.cjs.map +1 -1
- package/dist/util/testHelpers.d.cts +3 -3
- package/dist/util/testHelpers.d.ts +3 -3
- package/dist/util/testHelpers.js +3 -3
- package/package.json +14 -13
- package/dist/chunk-OTVTKAN6.js.map +0 -1
- /package/dist/{chunk-D2DHRRBN.js.map → chunk-JA7XGTAL.js.map} +0 -0
- /package/dist/{chunk-GN4YEXT7.js.map → chunk-LTSLICON.js.map} +0 -0
- /package/dist/{chunk-WUL63FR6.js.map → chunk-MQCGG6KL.js.map} +0 -0
- /package/dist/{chunk-BEALFLCB.js.map → chunk-R47IZD67.js.map} +0 -0
- /package/dist/{chunk-YCLZWES2.js.map → chunk-UDXM64QK.js.map} +0 -0
package/dist/transport/index.cjs
CHANGED
|
@@ -252,7 +252,7 @@ var import_nanoid2 = require("nanoid");
|
|
|
252
252
|
var import_api = require("@opentelemetry/api");
|
|
253
253
|
|
|
254
254
|
// package.json
|
|
255
|
-
var version = "0.23.
|
|
255
|
+
var version = "0.23.16";
|
|
256
256
|
|
|
257
257
|
// tracing/index.ts
|
|
258
258
|
function getPropagationContext(ctx) {
|
|
@@ -572,6 +572,18 @@ var Session = class {
|
|
|
572
572
|
get nextExpectedSeq() {
|
|
573
573
|
return this.ack;
|
|
574
574
|
}
|
|
575
|
+
/**
|
|
576
|
+
* Check that the peer's next expected seq number matches something that is in our send buffer
|
|
577
|
+
* _or_ matches our actual next seq.
|
|
578
|
+
*/
|
|
579
|
+
nextExpectedSeqInRange(nextExpectedSeq) {
|
|
580
|
+
for (const msg of this.sendBuffer) {
|
|
581
|
+
if (nextExpectedSeq === msg.seq) {
|
|
582
|
+
return true;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
return nextExpectedSeq === this.seq;
|
|
586
|
+
}
|
|
575
587
|
// This is only used in tests to make the session misbehave.
|
|
576
588
|
/* @internal */
|
|
577
589
|
advanceAckForTesting(by) {
|
|
@@ -756,6 +768,20 @@ var Transport = class {
|
|
|
756
768
|
if (this.log) {
|
|
757
769
|
session.bindLogger(this.log);
|
|
758
770
|
}
|
|
771
|
+
const currentSession = this.sessions.get(session.to);
|
|
772
|
+
if (currentSession) {
|
|
773
|
+
this.log?.warn(
|
|
774
|
+
`session ${session.id} from ${session.to} surreptitiously replacing ${currentSession.id}`,
|
|
775
|
+
{
|
|
776
|
+
...currentSession.loggingMetadata,
|
|
777
|
+
tags: ["invariant-violation"]
|
|
778
|
+
}
|
|
779
|
+
);
|
|
780
|
+
this.deleteSession({
|
|
781
|
+
session: currentSession,
|
|
782
|
+
closeHandshakingConnection: false
|
|
783
|
+
});
|
|
784
|
+
}
|
|
759
785
|
this.sessions.set(session.to, session);
|
|
760
786
|
this.eventDispatcher.dispatchEvent("sessionStatus", {
|
|
761
787
|
status: "connect",
|
|
@@ -795,7 +821,7 @@ var Transport = class {
|
|
|
795
821
|
if (
|
|
796
822
|
// reject this request if there was no previous session to replace
|
|
797
823
|
session === void 0 || // or if both parties do not agree about the next expected sequence number
|
|
798
|
-
session.
|
|
824
|
+
!session.nextExpectedSeqInRange(nextExpectedSeq) || // or if both parties do not agree on the advertised session id
|
|
799
825
|
session.advertisedSessionId !== sessionId
|
|
800
826
|
) {
|
|
801
827
|
return false;
|
|
@@ -854,6 +880,17 @@ var Transport = class {
|
|
|
854
880
|
}
|
|
855
881
|
session.close();
|
|
856
882
|
session.telemetry.span.end();
|
|
883
|
+
const currentSession = this.sessions.get(session.to);
|
|
884
|
+
if (currentSession && currentSession.id !== session.id) {
|
|
885
|
+
this.log?.warn(
|
|
886
|
+
`session ${session.id} disconnect from ${session.to}, mismatch with ${currentSession.id}`,
|
|
887
|
+
{
|
|
888
|
+
...session.loggingMetadata,
|
|
889
|
+
tags: ["invariant-violation"]
|
|
890
|
+
}
|
|
891
|
+
);
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
857
894
|
this.sessions.delete(session.to);
|
|
858
895
|
this.log?.info(
|
|
859
896
|
`session ${session.id} disconnect from ${session.to}`,
|