@replit/river 0.26.3 → 0.26.5

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 (43) hide show
  1. package/dist/{chunk-MZELCWJK.js → chunk-7KB7DHFZ.js} +4 -9
  2. package/dist/chunk-7KB7DHFZ.js.map +1 -0
  3. package/dist/{chunk-X35QRIA5.js → chunk-AZ3ILPXP.js} +5 -5
  4. package/dist/chunk-AZ3ILPXP.js.map +1 -0
  5. package/dist/{chunk-3JCZNGF7.js → chunk-FA2IRWCM.js} +2 -2
  6. package/dist/{chunk-JI6FFDY5.js → chunk-IPOUVVKT.js} +3 -3
  7. package/dist/{chunk-BB2E5L4U.js → chunk-PZEYFHAB.js} +24 -24
  8. package/dist/chunk-PZEYFHAB.js.map +1 -0
  9. package/dist/{chunk-ZY2HYJ5Y.js → chunk-QEWSUVWV.js} +2 -2
  10. package/dist/{chunk-ZY2HYJ5Y.js.map → chunk-QEWSUVWV.js.map} +1 -1
  11. package/dist/{chunk-OCL2FUTQ.js → chunk-XRZ52TYH.js} +15 -13
  12. package/dist/{chunk-OCL2FUTQ.js.map → chunk-XRZ52TYH.js.map} +1 -1
  13. package/dist/{client-1894a9c9.d.ts → client-6c67339a.d.ts} +1 -1
  14. package/dist/router/index.cjs +3 -8
  15. package/dist/router/index.cjs.map +1 -1
  16. package/dist/router/index.d.cts +4 -4
  17. package/dist/router/index.d.ts +4 -4
  18. package/dist/router/index.js +2 -2
  19. package/dist/{services-491d8c32.d.ts → services-6140f578.d.ts} +1 -1
  20. package/dist/transport/impls/ws/client.cjs +36 -39
  21. package/dist/transport/impls/ws/client.cjs.map +1 -1
  22. package/dist/transport/impls/ws/client.d.cts +1 -1
  23. package/dist/transport/impls/ws/client.d.ts +1 -1
  24. package/dist/transport/impls/ws/client.js +5 -5
  25. package/dist/transport/impls/ws/server.cjs +17 -20
  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 +37 -40
  29. package/dist/transport/index.cjs.map +1 -1
  30. package/dist/transport/index.d.cts +1 -1
  31. package/dist/transport/index.d.ts +1 -1
  32. package/dist/transport/index.js +5 -5
  33. package/dist/util/testHelpers.cjs +16 -19
  34. package/dist/util/testHelpers.cjs.map +1 -1
  35. package/dist/util/testHelpers.d.cts +2 -2
  36. package/dist/util/testHelpers.d.ts +2 -2
  37. package/dist/util/testHelpers.js +3 -3
  38. package/package.json +1 -1
  39. package/dist/chunk-BB2E5L4U.js.map +0 -1
  40. package/dist/chunk-MZELCWJK.js.map +0 -1
  41. package/dist/chunk-X35QRIA5.js.map +0 -1
  42. /package/dist/{chunk-3JCZNGF7.js.map → chunk-FA2IRWCM.js.map} +0 -0
  43. /package/dist/{chunk-JI6FFDY5.js.map → chunk-IPOUVVKT.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { C as ClientTransport } from '../../../client-1894a9c9.js';
1
+ import { C as ClientTransport } from '../../../client-6c67339a.js';
2
2
  import { c as TransportClientId } from '../../../message-ff78a233.js';
3
3
  import { b as ProvidedClientTransportOptions } from '../../../handshake-154a0bb2.js';
4
4
  import { W as WebSocketConnection } from '../../../connection-03ffb583.js';
@@ -1,4 +1,4 @@
1
- import { C as ClientTransport } from '../../../client-1894a9c9.js';
1
+ import { C as ClientTransport } from '../../../client-6c67339a.js';
2
2
  import { c as TransportClientId } from '../../../message-ff78a233.js';
3
3
  import { b as ProvidedClientTransportOptions } from '../../../handshake-154a0bb2.js';
4
4
  import { W as WebSocketConnection } from '../../../connection-03ffb583.js';
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ClientTransport
3
- } from "../../../chunk-BB2E5L4U.js";
3
+ } from "../../../chunk-PZEYFHAB.js";
4
4
  import {
5
5
  WebSocketConnection
6
- } from "../../../chunk-ZY2HYJ5Y.js";
7
- import "../../../chunk-JI6FFDY5.js";
6
+ } from "../../../chunk-QEWSUVWV.js";
7
+ import "../../../chunk-IPOUVVKT.js";
8
8
  import "../../../chunk-TAH2GVTJ.js";
9
- import "../../../chunk-OCL2FUTQ.js";
10
- import "../../../chunk-MZELCWJK.js";
9
+ import "../../../chunk-XRZ52TYH.js";
10
+ import "../../../chunk-7KB7DHFZ.js";
11
11
  import "../../../chunk-4PVU7J25.js";
12
12
 
13
13
  // transport/impls/ws/client.ts
@@ -186,10 +186,7 @@ var ControlMessageHandshakeRequestSchema = import_typebox.Type.Object({
186
186
  expectedSessionState: import_typebox.Type.Object({
187
187
  // what the client expects the server to send next
188
188
  nextExpectedSeq: import_typebox.Type.Integer(),
189
- // TODO: remove optional once we know all servers
190
- // are nextSentSeq here
191
- // what the server expects the client to send next
192
- nextSentSeq: import_typebox.Type.Optional(import_typebox.Type.Integer())
189
+ nextSentSeq: import_typebox.Type.Integer()
193
190
  }),
194
191
  metadata: import_typebox.Type.Optional(import_typebox.Type.Unknown())
195
192
  });
@@ -225,9 +222,7 @@ var ControlMessageHandshakeResponseSchema = import_typebox.Type.Object({
225
222
  import_typebox.Type.Object({
226
223
  ok: import_typebox.Type.Literal(false),
227
224
  reason: import_typebox.Type.String(),
228
- // TODO: remove optional once we know all servers
229
- // are sending code here
230
- code: import_typebox.Type.Optional(HandshakeErrorResponseCodes)
225
+ code: HandshakeErrorResponseCodes
231
226
  })
232
227
  ])
233
228
  });
@@ -612,9 +607,6 @@ var SessionConnecting = class extends IdentifiedSessionWithGracePeriod {
612
607
  super(props);
613
608
  this.connPromise = props.connPromise;
614
609
  this.listeners = props.listeners;
615
- this.connectionTimeout = setTimeout(() => {
616
- this.listeners.onConnectionTimeout();
617
- }, this.options.connectionTimeoutMs);
618
610
  this.connPromise.then(
619
611
  (conn) => {
620
612
  if (this._isConsumed)
@@ -627,16 +619,21 @@ var SessionConnecting = class extends IdentifiedSessionWithGracePeriod {
627
619
  this.listeners.onConnectionFailed(err);
628
620
  }
629
621
  );
622
+ this.connectionTimeout = setTimeout(() => {
623
+ this.listeners.onConnectionTimeout();
624
+ }, this.options.connectionTimeoutMs);
630
625
  }
631
626
  // close a pending connection if it resolves, ignore errors if the promise
632
627
  // ends up rejected anyways
633
628
  bestEffortClose() {
634
- void this.connPromise.then((conn) => {
629
+ const logger = this.log;
630
+ const metadata = this.loggingMetadata;
631
+ this.connPromise.then((conn) => {
635
632
  conn.close();
636
- this.log?.info(
633
+ logger?.info(
637
634
  "connection eventually resolved but session has transitioned, closed connection",
638
635
  {
639
- ...this.loggingMetadata,
636
+ ...metadata,
640
637
  ...conn.loggingMetadata
641
638
  }
642
639
  );
@@ -671,7 +668,7 @@ var SessionNoConnection = class extends IdentifiedSessionWithGracePeriod {
671
668
  var import_api = require("@opentelemetry/api");
672
669
 
673
670
  // package.json
674
- var version = "0.26.3";
671
+ var version = "0.26.5";
675
672
 
676
673
  // tracing/index.ts
677
674
  function createSessionTelemetryInfo(sessionId, to, from, propagationCtx) {
@@ -824,13 +821,13 @@ var SessionConnected = class extends IdentifiedSession {
824
821
  this.conn.addCloseListener(this.listeners.onConnectionClosed);
825
822
  this.conn.addErrorListener(this.listeners.onConnectionErrored);
826
823
  if (this.sendBuffer.length > 0) {
827
- this.log?.debug(
828
- `sending ${this.sendBuffer.length} buffered messages`,
824
+ this.log?.info(
825
+ `sending ${this.sendBuffer.length} buffered messages, starting at seq ${this.nextSeq()}`,
829
826
  this.loggingMetadata
830
827
  );
831
- }
832
- for (const msg of this.sendBuffer) {
833
- this.conn.send(this.options.codec.toBuffer(msg));
828
+ for (const msg of this.sendBuffer) {
829
+ this.conn.send(this.options.codec.toBuffer(msg));
830
+ }
834
831
  }
835
832
  this.isActivelyHeartbeating = false;
836
833
  this.heartbeatHandle = setInterval(() => {
@@ -1645,7 +1642,7 @@ var ServerTransport = class extends Transport {
1645
1642
  }
1646
1643
  let connectCase = "new session";
1647
1644
  const clientNextExpectedSeq = msg.payload.expectedSessionState.nextExpectedSeq;
1648
- const clientNextSentSeq = msg.payload.expectedSessionState.nextSentSeq ?? 0;
1645
+ const clientNextSentSeq = msg.payload.expectedSessionState.nextSentSeq;
1649
1646
  if (this.options.enableTransparentSessionReconnects && oldSession && oldSession.id === msg.payload.sessionId) {
1650
1647
  connectCase = "transparent reconnection";
1651
1648
  const ourNextSeq = oldSession.nextSeq();