@replit/river 0.207.1 → 0.207.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.
Files changed (39) hide show
  1. package/dist/{chunk-QMAVXV4Z.js → chunk-24EWYOGK.js} +21 -10
  2. package/dist/chunk-24EWYOGK.js.map +1 -0
  3. package/dist/{chunk-BCCZA7SX.js → chunk-46IVOKJU.js} +2 -2
  4. package/dist/{chunk-BCCZA7SX.js.map → chunk-46IVOKJU.js.map} +1 -1
  5. package/dist/{chunk-7LMZNSVC.js → chunk-4HE7UYRL.js} +2 -2
  6. package/dist/{chunk-CRD3HDVN.js → chunk-A7RGOVRV.js} +3 -3
  7. package/dist/{chunk-I27WBSMZ.js → chunk-XV4RQ62N.js} +3 -3
  8. package/dist/{connection-933c87b2.d.ts → connection-a18e31d5.d.ts} +1 -1
  9. package/dist/router/index.cjs +1 -1
  10. package/dist/router/index.cjs.map +1 -1
  11. package/dist/router/index.d.cts +3 -3
  12. package/dist/router/index.d.ts +3 -3
  13. package/dist/router/index.js +1 -1
  14. package/dist/{services-4cd29829.d.ts → services-43528f4b.d.ts} +2 -1
  15. package/dist/testUtil/index.cjs +20 -9
  16. package/dist/testUtil/index.cjs.map +1 -1
  17. package/dist/testUtil/index.d.cts +1 -1
  18. package/dist/testUtil/index.d.ts +1 -1
  19. package/dist/testUtil/index.js +4 -4
  20. package/dist/transport/impls/ws/client.cjs +20 -9
  21. package/dist/transport/impls/ws/client.cjs.map +1 -1
  22. package/dist/transport/impls/ws/client.d.cts +2 -2
  23. package/dist/transport/impls/ws/client.d.ts +2 -2
  24. package/dist/transport/impls/ws/client.js +4 -4
  25. package/dist/transport/impls/ws/server.cjs +20 -9
  26. package/dist/transport/impls/ws/server.cjs.map +1 -1
  27. package/dist/transport/impls/ws/server.d.cts +2 -2
  28. package/dist/transport/impls/ws/server.d.ts +2 -2
  29. package/dist/transport/impls/ws/server.js +4 -4
  30. package/dist/transport/index.cjs +20 -9
  31. package/dist/transport/index.cjs.map +1 -1
  32. package/dist/transport/index.d.cts +2 -2
  33. package/dist/transport/index.d.ts +2 -2
  34. package/dist/transport/index.js +4 -4
  35. package/package.json +1 -1
  36. package/dist/chunk-QMAVXV4Z.js.map +0 -1
  37. /package/dist/{chunk-7LMZNSVC.js.map → chunk-4HE7UYRL.js.map} +0 -0
  38. /package/dist/{chunk-CRD3HDVN.js.map → chunk-A7RGOVRV.js.map} +0 -0
  39. /package/dist/{chunk-I27WBSMZ.js.map → chunk-XV4RQ62N.js.map} +0 -0
@@ -1,6 +1,6 @@
1
- import { C as ClientTransport, P as ProvidedClientTransportOptions } from '../../../services-4cd29829.js';
1
+ import { C as ClientTransport, P as ProvidedClientTransportOptions } from '../../../services-43528f4b.js';
2
2
  import { T as TransportClientId } from '../../../message-ffacb98a.js';
3
- import { W as WebSocketConnection } from '../../../connection-933c87b2.js';
3
+ import { W as WebSocketConnection } from '../../../connection-a18e31d5.js';
4
4
  import { W as WsLike } from '../../../wslike-e0b32dd5.js';
5
5
  import '@sinclair/typebox';
6
6
  import '@opentelemetry/api';
@@ -1,6 +1,6 @@
1
- import { C as ClientTransport, P as ProvidedClientTransportOptions } from '../../../services-4cd29829.js';
1
+ import { C as ClientTransport, P as ProvidedClientTransportOptions } from '../../../services-43528f4b.js';
2
2
  import { T as TransportClientId } from '../../../message-ffacb98a.js';
3
- import { W as WebSocketConnection } from '../../../connection-933c87b2.js';
3
+ import { W as WebSocketConnection } from '../../../connection-a18e31d5.js';
4
4
  import { W as WsLike } from '../../../wslike-e0b32dd5.js';
5
5
  import '@sinclair/typebox';
6
6
  import '@opentelemetry/api';
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ClientTransport
3
- } from "../../../chunk-CRD3HDVN.js";
3
+ } from "../../../chunk-A7RGOVRV.js";
4
4
  import {
5
5
  WebSocketConnection
6
- } from "../../../chunk-7LMZNSVC.js";
7
- import "../../../chunk-QMAVXV4Z.js";
8
- import "../../../chunk-BCCZA7SX.js";
6
+ } from "../../../chunk-4HE7UYRL.js";
7
+ import "../../../chunk-24EWYOGK.js";
8
+ import "../../../chunk-46IVOKJU.js";
9
9
  import "../../../chunk-CC7RN7GI.js";
10
10
  import "../../../chunk-AJGIY2UB.js";
11
11
 
@@ -740,7 +740,7 @@ function coerceErrorString(err) {
740
740
  }
741
741
 
742
742
  // package.json
743
- var version = "0.207.1";
743
+ var version = "0.207.2";
744
744
 
745
745
  // tracing/index.ts
746
746
  function createSessionTelemetryInfo(tracer, sessionId, to, from, propagationCtx) {
@@ -891,6 +891,19 @@ var SessionConnected = class extends IdentifiedSession {
891
891
  heartbeatHandle;
892
892
  heartbeatMisses = 0;
893
893
  isActivelyHeartbeating;
894
+ lastConstructedMsgs = [];
895
+ pushLastConstructedMsgs = (msg) => {
896
+ const trackedMsg = {
897
+ id: msg.id,
898
+ seq: msg.seq,
899
+ streamId: msg.streamId,
900
+ stack: new Error().stack
901
+ };
902
+ this.lastConstructedMsgs.push(trackedMsg);
903
+ if (this.lastConstructedMsgs.length > 10) {
904
+ this.lastConstructedMsgs.shift();
905
+ }
906
+ };
894
907
  updateBookkeeping(ack, seq) {
895
908
  this.sendBuffer = this.sendBuffer.filter((unacked) => unacked.seq >= ack);
896
909
  this.ack = seq + 1;
@@ -902,13 +915,17 @@ var SessionConnected = class extends IdentifiedSession {
902
915
  this.log?.error(msg, {
903
916
  ...this.loggingMetadata,
904
917
  transportMessage: constructedMsg,
905
- tags: ["invariant-violation"]
918
+ tags: ["invariant-violation"],
919
+ extras: {
920
+ lastConstructedMsgs: this.lastConstructedMsgs
921
+ }
906
922
  });
907
923
  throw new Error(msg);
908
924
  }
909
925
  }
910
926
  send(msg) {
911
927
  const constructedMsg = this.constructMsg(msg);
928
+ this.pushLastConstructedMsgs(constructedMsg);
912
929
  this.assertSendOrdering(constructedMsg);
913
930
  this.sendBuffer.push(constructedMsg);
914
931
  this.conn.send(this.options.codec.toBuffer(constructedMsg));
@@ -973,12 +990,6 @@ var SessionConnected = class extends IdentifiedSession {
973
990
  }
974
991
  });
975
992
  }
976
- closeConnection() {
977
- this.conn.removeDataListener(this.onMessageData);
978
- this.conn.removeCloseListener(this.listeners.onConnectionClosed);
979
- this.conn.removeErrorListener(this.listeners.onConnectionErrored);
980
- this.conn.close();
981
- }
982
993
  onMessageData = (msg) => {
983
994
  const parsedMsg = this.parseMsg(msg);
984
995
  if (parsedMsg === null) {
@@ -1005,7 +1016,7 @@ var SessionConnected = class extends IdentifiedSession {
1005
1016
  code: import_api3.SpanStatusCode.ERROR,
1006
1017
  message: reason
1007
1018
  });
1008
- this.closeConnection();
1019
+ this.conn.close();
1009
1020
  }
1010
1021
  return;
1011
1022
  }