@replit/river 0.26.3 → 0.26.4

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 (42) hide show
  1. package/dist/{chunk-OCL2FUTQ.js → chunk-42SXIIHP.js} +10 -8
  2. package/dist/chunk-42SXIIHP.js.map +1 -0
  3. package/dist/{chunk-MZELCWJK.js → chunk-65EMTMCV.js} +2 -2
  4. package/dist/{chunk-MZELCWJK.js.map → chunk-65EMTMCV.js.map} +1 -1
  5. package/dist/{chunk-ZY2HYJ5Y.js → chunk-CYD6GTCU.js} +2 -2
  6. package/dist/{chunk-X35QRIA5.js → chunk-DS5LF6PS.js} +4 -4
  7. package/dist/{chunk-BB2E5L4U.js → chunk-HPOR6FST.js} +22 -22
  8. package/dist/chunk-HPOR6FST.js.map +1 -0
  9. package/dist/{chunk-3JCZNGF7.js → chunk-PXRKBNWN.js} +2 -2
  10. package/dist/{chunk-JI6FFDY5.js → chunk-RSCUADHY.js} +3 -3
  11. package/dist/{client-1894a9c9.d.ts → client-6c67339a.d.ts} +1 -1
  12. package/dist/router/index.cjs +1 -1
  13. package/dist/router/index.cjs.map +1 -1
  14. package/dist/router/index.d.cts +4 -4
  15. package/dist/router/index.d.ts +4 -4
  16. package/dist/router/index.js +2 -2
  17. package/dist/{services-491d8c32.d.ts → services-6140f578.d.ts} +1 -1
  18. package/dist/transport/impls/ws/client.cjs +27 -25
  19. package/dist/transport/impls/ws/client.cjs.map +1 -1
  20. package/dist/transport/impls/ws/client.d.cts +1 -1
  21. package/dist/transport/impls/ws/client.d.ts +1 -1
  22. package/dist/transport/impls/ws/client.js +5 -5
  23. package/dist/transport/impls/ws/server.cjs +9 -7
  24. package/dist/transport/impls/ws/server.cjs.map +1 -1
  25. package/dist/transport/impls/ws/server.js +5 -5
  26. package/dist/transport/index.cjs +27 -25
  27. package/dist/transport/index.cjs.map +1 -1
  28. package/dist/transport/index.d.cts +1 -1
  29. package/dist/transport/index.d.ts +1 -1
  30. package/dist/transport/index.js +5 -5
  31. package/dist/util/testHelpers.cjs +9 -7
  32. package/dist/util/testHelpers.cjs.map +1 -1
  33. package/dist/util/testHelpers.d.cts +2 -2
  34. package/dist/util/testHelpers.d.ts +2 -2
  35. package/dist/util/testHelpers.js +3 -3
  36. package/package.json +1 -1
  37. package/dist/chunk-BB2E5L4U.js.map +0 -1
  38. package/dist/chunk-OCL2FUTQ.js.map +0 -1
  39. /package/dist/{chunk-ZY2HYJ5Y.js.map → chunk-CYD6GTCU.js.map} +0 -0
  40. /package/dist/{chunk-X35QRIA5.js.map → chunk-DS5LF6PS.js.map} +0 -0
  41. /package/dist/{chunk-3JCZNGF7.js.map → chunk-PXRKBNWN.js.map} +0 -0
  42. /package/dist/{chunk-JI6FFDY5.js.map → chunk-RSCUADHY.js.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ServerTransport
3
- } from "../../../chunk-X35QRIA5.js";
3
+ } from "../../../chunk-DS5LF6PS.js";
4
4
  import {
5
5
  WebSocketConnection
6
- } from "../../../chunk-ZY2HYJ5Y.js";
7
- import "../../../chunk-JI6FFDY5.js";
6
+ } from "../../../chunk-CYD6GTCU.js";
7
+ import "../../../chunk-RSCUADHY.js";
8
8
  import "../../../chunk-TAH2GVTJ.js";
9
- import "../../../chunk-OCL2FUTQ.js";
10
- import "../../../chunk-MZELCWJK.js";
9
+ import "../../../chunk-42SXIIHP.js";
10
+ import "../../../chunk-65EMTMCV.js";
11
11
  import "../../../chunk-4PVU7J25.js";
12
12
 
13
13
  // transport/impls/ws/server.ts
@@ -540,9 +540,6 @@ var SessionConnecting = class extends IdentifiedSessionWithGracePeriod {
540
540
  super(props);
541
541
  this.connPromise = props.connPromise;
542
542
  this.listeners = props.listeners;
543
- this.connectionTimeout = setTimeout(() => {
544
- this.listeners.onConnectionTimeout();
545
- }, this.options.connectionTimeoutMs);
546
543
  this.connPromise.then(
547
544
  (conn) => {
548
545
  if (this._isConsumed)
@@ -555,16 +552,21 @@ var SessionConnecting = class extends IdentifiedSessionWithGracePeriod {
555
552
  this.listeners.onConnectionFailed(err);
556
553
  }
557
554
  );
555
+ this.connectionTimeout = setTimeout(() => {
556
+ this.listeners.onConnectionTimeout();
557
+ }, this.options.connectionTimeoutMs);
558
558
  }
559
559
  // close a pending connection if it resolves, ignore errors if the promise
560
560
  // ends up rejected anyways
561
561
  bestEffortClose() {
562
- void this.connPromise.then((conn) => {
562
+ const logger = this.log;
563
+ const metadata = this.loggingMetadata;
564
+ this.connPromise.then((conn) => {
563
565
  conn.close();
564
- this.log?.info(
566
+ logger?.info(
565
567
  "connection eventually resolved but session has transitioned, closed connection",
566
568
  {
567
- ...this.loggingMetadata,
569
+ ...metadata,
568
570
  ...conn.loggingMetadata
569
571
  }
570
572
  );
@@ -599,7 +601,7 @@ var SessionNoConnection = class extends IdentifiedSessionWithGracePeriod {
599
601
  var import_api = require("@opentelemetry/api");
600
602
 
601
603
  // package.json
602
- var version = "0.26.3";
604
+ var version = "0.26.4";
603
605
 
604
606
  // tracing/index.ts
605
607
  function getPropagationContext(ctx) {
@@ -1669,22 +1671,7 @@ var ClientTransport = class extends Transport {
1669
1671
  backoffMs,
1670
1672
  {
1671
1673
  onBackoffFinished: () => {
1672
- const reconnectPromise = tracing_default.startActiveSpan(
1673
- "connect",
1674
- async (span) => {
1675
- try {
1676
- return await this.createNewOutgoingConnection(to);
1677
- } catch (err) {
1678
- const errStr = coerceErrorString(err);
1679
- span.recordException(errStr);
1680
- span.setStatus({ code: import_api3.SpanStatusCode.ERROR });
1681
- throw err;
1682
- } finally {
1683
- span.end();
1684
- }
1685
- }
1686
- );
1687
- this.onBackoffFinished(backingOffSession, reconnectPromise);
1674
+ this.onBackoffFinished(backingOffSession);
1688
1675
  },
1689
1676
  onSessionGracePeriodElapsed: () => {
1690
1677
  this.onSessionGracePeriodElapsed(backingOffSession);
@@ -1693,7 +1680,19 @@ var ClientTransport = class extends Transport {
1693
1680
  );
1694
1681
  this.updateSession(backingOffSession);
1695
1682
  }
1696
- onBackoffFinished(session, connPromise) {
1683
+ onBackoffFinished(session) {
1684
+ const connPromise = tracing_default.startActiveSpan("connect", async (span) => {
1685
+ try {
1686
+ return await this.createNewOutgoingConnection(session.to);
1687
+ } catch (err) {
1688
+ const errStr = coerceErrorString(err);
1689
+ span.recordException(errStr);
1690
+ span.setStatus({ code: import_api3.SpanStatusCode.ERROR });
1691
+ throw err;
1692
+ } finally {
1693
+ span.end();
1694
+ }
1695
+ });
1697
1696
  const connectingSession = ClientSessionStateGraph.transition.BackingOffToConnecting(
1698
1697
  session,
1699
1698
  connPromise,
@@ -1701,7 +1700,10 @@ var ClientTransport = class extends Transport {
1701
1700
  onConnectionEstablished: (conn) => {
1702
1701
  this.log?.debug(
1703
1702
  `connection to ${connectingSession.to} established`,
1704
- connectingSession.loggingMetadata
1703
+ {
1704
+ ...conn.loggingMetadata,
1705
+ ...connectingSession.loggingMetadata
1706
+ }
1705
1707
  );
1706
1708
  this.onConnectionEstablished(connectingSession, conn);
1707
1709
  },