@replit/river 0.212.0 → 0.212.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.
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ServerTransport,
3
3
  WebSocketConnection
4
- } from "../../../chunk-FW4QYF33.js";
4
+ } from "../../../chunk-JPNTEDEA.js";
5
+ import "../../../chunk-6KQ3NG67.js";
5
6
  import "../../../chunk-CC7RN7GI.js";
6
- import "../../../chunk-S6I4XLQG.js";
7
7
 
8
8
  // transport/impls/ws/server.ts
9
9
  function cleanHeaders(headers) {
@@ -647,7 +647,7 @@ function coerceErrorString(err) {
647
647
  }
648
648
 
649
649
  // package.json
650
- var version = "0.212.0";
650
+ var version = "0.212.2";
651
651
 
652
652
  // tracing/index.ts
653
653
  function getPropagationContext(ctx) {
@@ -1992,7 +1992,21 @@ var ClientTransport = class extends Transport {
1992
1992
  async sendHandshake(session) {
1993
1993
  let metadata = void 0;
1994
1994
  if (this.handshakeExtensions) {
1995
- metadata = await this.handshakeExtensions.construct();
1995
+ try {
1996
+ metadata = await this.handshakeExtensions.construct();
1997
+ } catch (err) {
1998
+ const errStr = coerceErrorString(err);
1999
+ this.log?.error(
2000
+ `failed to construct handshake metadata for session to ${session.to}: ${errStr}`,
2001
+ session.loggingMetadata
2002
+ );
2003
+ this.protocolError({
2004
+ type: ProtocolError.HandshakeFailed,
2005
+ message: `failed to construct handshake metadata: ${errStr}`
2006
+ });
2007
+ this.deleteSession(session, { unhealthy: true });
2008
+ return;
2009
+ }
1996
2010
  }
1997
2011
  if (session._isConsumed) {
1998
2012
  return;