@riddix/hamh 2.1.0-alpha.529 → 2.1.0-alpha.530
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/dist/backend/cli.js
CHANGED
|
@@ -167168,9 +167168,9 @@ ${e?.toString()}`);
|
|
|
167168
167168
|
`Closing stale session ${s.id} (peer ${s.peerNodeId}, no subscriptions for ${DEAD_SESSION_TIMEOUT_MS / 1e3}s)`
|
|
167169
167169
|
);
|
|
167170
167170
|
s.initiateClose().catch(() => {
|
|
167171
|
-
s.initiateForceClose()
|
|
167172
|
-
|
|
167173
|
-
});
|
|
167171
|
+
return s.initiateForceClose();
|
|
167172
|
+
}).catch(() => {
|
|
167173
|
+
}).finally(() => this.triggerMdnsReAnnounce());
|
|
167174
167174
|
break;
|
|
167175
167175
|
}
|
|
167176
167176
|
}
|
|
@@ -167181,17 +167181,37 @@ ${e?.toString()}`);
|
|
|
167181
167181
|
try {
|
|
167182
167182
|
const sessionManager = this.server.env.get(SessionManager);
|
|
167183
167183
|
const sessions = [...sessionManager.sessions];
|
|
167184
|
+
const closes = [];
|
|
167184
167185
|
for (const s of sessions) {
|
|
167185
167186
|
if (!s.isClosing && s.subscriptions.size === 0) {
|
|
167186
167187
|
this.log.warn(
|
|
167187
167188
|
`Closing dead session ${s.id} (peer ${s.peerNodeId}, no subscriptions for ${DEAD_SESSION_TIMEOUT_MS / 1e3}s)`
|
|
167188
167189
|
);
|
|
167189
|
-
|
|
167190
|
-
s.
|
|
167191
|
-
|
|
167192
|
-
|
|
167190
|
+
closes.push(
|
|
167191
|
+
s.initiateClose().catch(() => {
|
|
167192
|
+
return s.initiateForceClose();
|
|
167193
|
+
})
|
|
167194
|
+
);
|
|
167193
167195
|
}
|
|
167194
167196
|
}
|
|
167197
|
+
if (closes.length > 0) {
|
|
167198
|
+
Promise.allSettled(closes).then(() => this.triggerMdnsReAnnounce());
|
|
167199
|
+
}
|
|
167200
|
+
} catch {
|
|
167201
|
+
}
|
|
167202
|
+
}
|
|
167203
|
+
/**
|
|
167204
|
+
* Force a fresh mDNS operational advertisement after session cleanup.
|
|
167205
|
+
* matter.js DeviceAdvertiser only re-announces when a subscription is
|
|
167206
|
+
* canceled BY THE PEER. When the server cancels after 3 delivery
|
|
167207
|
+
* timeouts, no re-announcement happens and the controller may not
|
|
167208
|
+
* realize it should reconnect (#266).
|
|
167209
|
+
*/
|
|
167210
|
+
triggerMdnsReAnnounce() {
|
|
167211
|
+
try {
|
|
167212
|
+
const advertiser = this.server.env.get(DeviceAdvertiser);
|
|
167213
|
+
advertiser.restartAdvertisement();
|
|
167214
|
+
this.log.info("Triggered mDNS re-announcement after session cleanup");
|
|
167195
167215
|
} catch {
|
|
167196
167216
|
}
|
|
167197
167217
|
}
|
|
@@ -180051,9 +180071,9 @@ ${e?.toString()}`);
|
|
|
180051
180071
|
`Closing stale session ${s.id} (peer ${s.peerNodeId}, no subscriptions for ${DEAD_SESSION_TIMEOUT_MS2 / 1e3}s)`
|
|
180052
180072
|
);
|
|
180053
180073
|
s.initiateClose().catch(() => {
|
|
180054
|
-
s.initiateForceClose()
|
|
180055
|
-
|
|
180056
|
-
});
|
|
180074
|
+
return s.initiateForceClose();
|
|
180075
|
+
}).catch(() => {
|
|
180076
|
+
}).finally(() => this.triggerMdnsReAnnounce());
|
|
180057
180077
|
break;
|
|
180058
180078
|
}
|
|
180059
180079
|
}
|
|
@@ -180064,17 +180084,37 @@ ${e?.toString()}`);
|
|
|
180064
180084
|
try {
|
|
180065
180085
|
const sessionManager = this.server.env.get(SessionManager);
|
|
180066
180086
|
const sessions = [...sessionManager.sessions];
|
|
180087
|
+
const closes = [];
|
|
180067
180088
|
for (const s of sessions) {
|
|
180068
180089
|
if (!s.isClosing && s.subscriptions.size === 0) {
|
|
180069
180090
|
this.log.warn(
|
|
180070
180091
|
`Closing dead session ${s.id} (peer ${s.peerNodeId}, no subscriptions for ${DEAD_SESSION_TIMEOUT_MS2 / 1e3}s)`
|
|
180071
180092
|
);
|
|
180072
|
-
|
|
180073
|
-
s.
|
|
180074
|
-
|
|
180075
|
-
|
|
180093
|
+
closes.push(
|
|
180094
|
+
s.initiateClose().catch(() => {
|
|
180095
|
+
return s.initiateForceClose();
|
|
180096
|
+
})
|
|
180097
|
+
);
|
|
180076
180098
|
}
|
|
180077
180099
|
}
|
|
180100
|
+
if (closes.length > 0) {
|
|
180101
|
+
Promise.allSettled(closes).then(() => this.triggerMdnsReAnnounce());
|
|
180102
|
+
}
|
|
180103
|
+
} catch {
|
|
180104
|
+
}
|
|
180105
|
+
}
|
|
180106
|
+
/**
|
|
180107
|
+
* Force a fresh mDNS operational advertisement after session cleanup.
|
|
180108
|
+
* matter.js DeviceAdvertiser only re-announces when a subscription is
|
|
180109
|
+
* canceled BY THE PEER. When the server cancels after 3 delivery
|
|
180110
|
+
* timeouts, no re-announcement happens and the controller may not
|
|
180111
|
+
* realize it should reconnect (#266).
|
|
180112
|
+
*/
|
|
180113
|
+
triggerMdnsReAnnounce() {
|
|
180114
|
+
try {
|
|
180115
|
+
const advertiser = this.server.env.get(DeviceAdvertiser);
|
|
180116
|
+
advertiser.restartAdvertisement();
|
|
180117
|
+
this.log.info("Triggered mDNS re-announcement after session cleanup");
|
|
180078
180118
|
} catch {
|
|
180079
180119
|
}
|
|
180080
180120
|
}
|