hypha-rpc 0.20.53 → 0.20.55

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.
@@ -1257,7 +1257,8 @@ class RPC extends _utils__WEBPACK_IMPORTED_MODULE_0__.MessageEmitter {
1257
1257
  // Generate debugging information for the method
1258
1258
  remote_method.__rpc_object__ = encoded_method;
1259
1259
  const parts = method_id.split(".");
1260
- remote_method.__name__ = parts[parts.length - 1];
1260
+
1261
+ remote_method.__name__ = encoded_method._rname || parts[parts.length - 1];
1261
1262
  if (remote_method.__name__.includes("#")) {
1262
1263
  remote_method.__name__ = remote_method.__name__.split("#")[1];
1263
1264
  }
@@ -1609,6 +1610,7 @@ class RPC extends _utils__WEBPACK_IMPORTED_MODULE_0__.MessageEmitter {
1609
1610
  _rtarget: this._client_id,
1610
1611
  _rmethod: annotation.method_id,
1611
1612
  _rpromise: "*",
1613
+ _rname: aObject.name,
1612
1614
  };
1613
1615
  } else {
1614
1616
  (0,_utils__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof session_id === "string");
@@ -1624,6 +1626,7 @@ class RPC extends _utils__WEBPACK_IMPORTED_MODULE_0__.MessageEmitter {
1624
1626
  _rtarget: this._client_id,
1625
1627
  _rmethod: `${session_id}.${object_id}`,
1626
1628
  _rpromise: "*",
1629
+ _rname: aObject.name,
1627
1630
  };
1628
1631
  let store = this._get_session_store(session_id, true);
1629
1632
  (0,_utils__WEBPACK_IMPORTED_MODULE_0__.assert)(
@@ -2736,6 +2739,7 @@ async function _setupRPC(config) {
2736
2739
  const connection = new WebRTCConnection(channel);
2737
2740
  config.context = config.context || {};
2738
2741
  config.context.connection_type = "webrtc";
2742
+ config.context.ws = config.workspace;
2739
2743
  const rpc = new _rpc_js__WEBPACK_IMPORTED_MODULE_0__.RPC(connection, {
2740
2744
  client_id: clientId,
2741
2745
  default_context: config.context,
@@ -5266,7 +5270,12 @@ class WebsocketRPCConnection {
5266
5270
  disconnect(reason) {
5267
5271
  this._closed = true;
5268
5272
  this._last_message = null; // Clear last message on disconnect
5269
- if (this._websocket && this._websocket.readyState === WebSocket.OPEN) {
5273
+ // Ensure websocket is closed if it exists and is not already closed or closing
5274
+ if (
5275
+ this._websocket &&
5276
+ this._websocket.readyState !== WebSocket.CLOSED &&
5277
+ this._websocket.readyState !== WebSocket.CLOSING
5278
+ ) {
5270
5279
  this._websocket.close(1000, reason);
5271
5280
  }
5272
5281
  if (this._refresh_token_task) {