hypha-rpc 0.21.29 → 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.
- package/coverage/html/index.html +1 -1
- package/dist/hypha-rpc-websocket.js +19 -8
- package/dist/hypha-rpc-websocket.js.map +1 -1
- package/dist/hypha-rpc-websocket.min.js +1 -1
- package/dist/hypha-rpc-websocket.min.js.map +1 -1
- package/dist/hypha-rpc-websocket.min.mjs +1 -1
- package/dist/hypha-rpc-websocket.min.mjs.map +1 -1
- package/dist/hypha-rpc-websocket.mjs +19 -8
- package/dist/hypha-rpc-websocket.mjs.map +1 -1
- package/package.json +1 -1
- package/src/rpc.js +19 -8
package/coverage/html/index.html
CHANGED
|
@@ -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-
|
|
89
|
+
at 2026-03-04T22:36:31.483Z
|
|
90
90
|
</div>
|
|
91
91
|
<script src="prettify.js"></script>
|
|
92
92
|
<script>
|
|
@@ -4022,6 +4022,13 @@ class RPC extends _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.MessageEmitter {
|
|
|
4022
4022
|
const serviceRegistrationTimeout = (this._method_timeout || 30) * 1000;
|
|
4023
4023
|
|
|
4024
4024
|
for (let service of services) {
|
|
4025
|
+
// Skip local-only services (e.g. _rintf_ callback proxies) —
|
|
4026
|
+
// they must never be registered with the server; doing so
|
|
4027
|
+
// creates zombie entries in Redis.
|
|
4028
|
+
if (service.config && service.config._local_only) {
|
|
4029
|
+
servicesCount--;
|
|
4030
|
+
continue;
|
|
4031
|
+
}
|
|
4025
4032
|
try {
|
|
4026
4033
|
const serviceInfo = this._extract_service_info(service);
|
|
4027
4034
|
await withTimeout(
|
|
@@ -4173,10 +4180,11 @@ class RPC extends _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.MessageEmitter {
|
|
|
4173
4180
|
// This ensures no remote function call hangs forever when the connection drops
|
|
4174
4181
|
if (typeof connection.on_disconnected === "function") {
|
|
4175
4182
|
connection.on_disconnected((reason) => {
|
|
4176
|
-
// If reconnection is enabled
|
|
4177
|
-
//
|
|
4178
|
-
//
|
|
4179
|
-
|
|
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) {
|
|
4180
4188
|
this._logger.info(
|
|
4181
4189
|
`Connection lost (${reason}), reconnection enabled - pending calls will be handled by timeout`,
|
|
4182
4190
|
);
|
|
@@ -6043,6 +6051,8 @@ class RPC extends _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.MessageEmitter {
|
|
|
6043
6051
|
get_client_info() {
|
|
6044
6052
|
const services = [];
|
|
6045
6053
|
for (let service of Object.values(this._services)) {
|
|
6054
|
+
// Exclude local-only services (e.g. _rintf_ callback proxies)
|
|
6055
|
+
if (service.config && service.config._local_only) continue;
|
|
6046
6056
|
services.push(this._extract_service_info(service));
|
|
6047
6057
|
}
|
|
6048
6058
|
|
|
@@ -6776,11 +6786,12 @@ class RPC extends _utils_index_js__WEBPACK_IMPORTED_MODULE_0__.MessageEmitter {
|
|
|
6776
6786
|
}
|
|
6777
6787
|
}
|
|
6778
6788
|
const serviceApi = { id: serviceId };
|
|
6789
|
+
serviceApi.config = {
|
|
6790
|
+
visibility: "protected",
|
|
6791
|
+
_local_only: true,
|
|
6792
|
+
};
|
|
6779
6793
|
if (allowedCaller) {
|
|
6780
|
-
serviceApi.config =
|
|
6781
|
-
visibility: "protected",
|
|
6782
|
-
_rintf_allowed_caller: allowedCaller,
|
|
6783
|
-
};
|
|
6794
|
+
serviceApi.config._rintf_allowed_caller = allowedCaller;
|
|
6784
6795
|
}
|
|
6785
6796
|
|
|
6786
6797
|
// Add _dispose method for active lifecycle management.
|