@replit/river 0.23.14 → 0.23.15

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.
Files changed (41) hide show
  1. package/dist/{chunk-O2AVDJCQ.js → chunk-5HK7ZQYH.js} +2 -2
  2. package/dist/{chunk-GN4YEXT7.js → chunk-AEY7BBOZ.js} +2 -2
  3. package/dist/{chunk-D2DHRRBN.js → chunk-IJTGEBLG.js} +4 -4
  4. package/dist/{chunk-WUL63FR6.js → chunk-JMVKSGND.js} +4 -4
  5. package/dist/{chunk-OTVTKAN6.js → chunk-MD4S7GO2.js} +28 -3
  6. package/dist/chunk-MD4S7GO2.js.map +1 -0
  7. package/dist/{chunk-GCCRVSMR.js → chunk-OXVWMLID.js} +2 -2
  8. package/dist/{chunk-GCCRVSMR.js.map → chunk-OXVWMLID.js.map} +1 -1
  9. package/dist/{chunk-BEALFLCB.js → chunk-RQQZUQGE.js} +2 -2
  10. package/dist/{chunk-YCLZWES2.js → chunk-XYEOXPZQ.js} +2 -2
  11. package/dist/router/index.cjs +1 -1
  12. package/dist/router/index.cjs.map +1 -1
  13. package/dist/router/index.d.cts +1 -1
  14. package/dist/router/index.d.ts +1 -1
  15. package/dist/router/index.js +2 -2
  16. package/dist/transport/impls/uds/client.cjs +26 -1
  17. package/dist/transport/impls/uds/client.cjs.map +1 -1
  18. package/dist/transport/impls/uds/client.js +5 -5
  19. package/dist/transport/impls/uds/server.cjs +26 -1
  20. package/dist/transport/impls/uds/server.cjs.map +1 -1
  21. package/dist/transport/impls/uds/server.js +5 -5
  22. package/dist/transport/impls/ws/client.cjs +26 -1
  23. package/dist/transport/impls/ws/client.cjs.map +1 -1
  24. package/dist/transport/impls/ws/client.js +5 -5
  25. package/dist/transport/impls/ws/server.cjs +26 -1
  26. package/dist/transport/impls/ws/server.cjs.map +1 -1
  27. package/dist/transport/impls/ws/server.js +5 -5
  28. package/dist/transport/index.cjs +26 -1
  29. package/dist/transport/index.cjs.map +1 -1
  30. package/dist/transport/index.js +5 -5
  31. package/dist/util/testHelpers.cjs +1 -1
  32. package/dist/util/testHelpers.cjs.map +1 -1
  33. package/dist/util/testHelpers.js +3 -3
  34. package/package.json +1 -1
  35. package/dist/chunk-OTVTKAN6.js.map +0 -1
  36. /package/dist/{chunk-O2AVDJCQ.js.map → chunk-5HK7ZQYH.js.map} +0 -0
  37. /package/dist/{chunk-GN4YEXT7.js.map → chunk-AEY7BBOZ.js.map} +0 -0
  38. /package/dist/{chunk-D2DHRRBN.js.map → chunk-IJTGEBLG.js.map} +0 -0
  39. /package/dist/{chunk-WUL63FR6.js.map → chunk-JMVKSGND.js.map} +0 -0
  40. /package/dist/{chunk-BEALFLCB.js.map → chunk-RQQZUQGE.js.map} +0 -0
  41. /package/dist/{chunk-YCLZWES2.js.map → chunk-XYEOXPZQ.js.map} +0 -0
@@ -83,6 +83,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
83
83
  extendedContext?: Omit<ServiceContext, 'state'>;
84
84
  }>): Server<Services>;
85
85
 
86
- var version = "0.23.14";
86
+ var version = "0.23.15";
87
87
 
88
88
  export { DiffOptions, PayloadBreakage, PayloadType, ProcedureBreakage, version as RIVER_VERSION, Result, RiverError, SerializedServerSchema, Server, ServerBreakage, ServiceBreakage, ServiceContext, createServer, diffServerSchema };
@@ -83,6 +83,6 @@ declare function createServer<Services extends AnyServiceSchemaMap>(transport: S
83
83
  extendedContext?: Omit<ServiceContext, 'state'>;
84
84
  }>): Server<Services>;
85
85
 
86
- var version = "0.23.14";
86
+ var version = "0.23.15";
87
87
 
88
88
  export { DiffOptions, PayloadBreakage, PayloadType, ProcedureBreakage, version as RIVER_VERSION, Result, RiverError, SerializedServerSchema, Server, ServerBreakage, ServiceBreakage, ServiceContext, createServer, diffServerSchema };
@@ -11,10 +11,10 @@ import {
11
11
  createServerHandshakeOptions,
12
12
  diffServerSchema,
13
13
  serializeSchema
14
- } from "../chunk-GN4YEXT7.js";
14
+ } from "../chunk-AEY7BBOZ.js";
15
15
  import {
16
16
  version
17
- } from "../chunk-GCCRVSMR.js";
17
+ } from "../chunk-OXVWMLID.js";
18
18
  export {
19
19
  Err,
20
20
  Ok,
@@ -134,7 +134,7 @@ function isAck(controlFlag) {
134
134
  var import_api = require("@opentelemetry/api");
135
135
 
136
136
  // package.json
137
- var version = "0.23.14";
137
+ var version = "0.23.15";
138
138
 
139
139
  // tracing/index.ts
140
140
  function getPropagationContext(ctx) {
@@ -901,6 +901,20 @@ var Transport = class {
901
901
  if (this.log) {
902
902
  session.bindLogger(this.log);
903
903
  }
904
+ const currentSession = this.sessions.get(session.to);
905
+ if (currentSession) {
906
+ this.log?.warn(
907
+ `session ${session.id} from ${session.to} surreptitiously replacing ${currentSession.id}`,
908
+ {
909
+ ...currentSession.loggingMetadata,
910
+ tags: ["invariant-violation"]
911
+ }
912
+ );
913
+ this.deleteSession({
914
+ session: currentSession,
915
+ closeHandshakingConnection: false
916
+ });
917
+ }
904
918
  this.sessions.set(session.to, session);
905
919
  this.eventDispatcher.dispatchEvent("sessionStatus", {
906
920
  status: "connect",
@@ -999,6 +1013,17 @@ var Transport = class {
999
1013
  }
1000
1014
  session.close();
1001
1015
  session.telemetry.span.end();
1016
+ const currentSession = this.sessions.get(session.to);
1017
+ if (currentSession && currentSession.id !== session.id) {
1018
+ this.log?.warn(
1019
+ `session ${session.id} disconnect from ${session.to}, mismatch with ${currentSession.id}`,
1020
+ {
1021
+ ...session.loggingMetadata,
1022
+ tags: ["invariant-violation"]
1023
+ }
1024
+ );
1025
+ return;
1026
+ }
1002
1027
  this.sessions.delete(session.to);
1003
1028
  this.log?.info(
1004
1029
  `session ${session.id} disconnect from ${session.to}`,