hypha-rpc 0.21.30 → 0.21.31

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.
@@ -86,7 +86,7 @@
86
86
  <div class='footer quiet pad2 space-top1 center small'>
87
87
  Code coverage generated by
88
88
  <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
89
- at 2026-03-01T13:11:19.376Z
89
+ at 2026-03-04T22:36:31.483Z
90
90
  </div>
91
91
  <script src="prettify.js"></script>
92
92
  <script>
@@ -4180,10 +4180,11 @@ class RPC extends _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.MessageEmitter {
4180
4180
  // This ensures no remote function call hangs forever when the connection drops
4181
4181
  if (typeof connection.on_disconnected === "function") {
4182
4182
  connection.on_disconnected((reason) => {
4183
- // If reconnection is enabled, don't reject pending calls immediately.
4184
- // The timeout mechanism will handle them if reconnection fails,
4185
- // allowing calls to succeed after a successful reconnection.
4186
- if (connection._enable_reconnect) {
4183
+ // If reconnection is enabled AND the connection is not permanently closed,
4184
+ // don't reject pending calls immediately they may succeed after reconnect.
4185
+ // When _closed is true (max retries exhausted or server refused reconnect),
4186
+ // we must reject immediately so callers are not left hanging forever.
4187
+ if (connection._enable_reconnect && !connection._closed) {
4187
4188
  this._logger.info(
4188
4189
  `Connection lost (${reason}), reconnection enabled - pending calls will be handled by timeout`,
4189
4190
  );