@iobroker/socket-classes 1.3.2 → 1.3.3
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/README.md +1 -1
- package/lib/socketCommands.js +6 -6
- package/lib/socketCommandsAdmin.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -978,7 +978,7 @@ Read all instances of the given adapter, or all instances of all adapters if ada
|
|
|
978
978
|
-->
|
|
979
979
|
|
|
980
980
|
## Changelog
|
|
981
|
-
### 1.3.
|
|
981
|
+
### 1.3.3 (2023-08-01)
|
|
982
982
|
* (bluefox) Implemented subscribes of a client on messages from specific instance
|
|
983
983
|
* (bluefox) Moved checkFeatureSupported to regular connection and not only admin
|
|
984
984
|
|
package/lib/socketCommands.js
CHANGED
|
@@ -238,11 +238,11 @@ class SocketCommands {
|
|
|
238
238
|
) {
|
|
239
239
|
socket.emit('im', messageType, sourceInstance, data);
|
|
240
240
|
return true;
|
|
241
|
-
} else {
|
|
242
|
-
// inform instance about missing subscription
|
|
243
|
-
this.adapter.sendTo(sourceInstance, 'clientSubscribeError', {type: messageType, sid: socket.id});
|
|
244
|
-
return false;
|
|
245
241
|
}
|
|
242
|
+
|
|
243
|
+
// inform instance about missing subscription
|
|
244
|
+
this.adapter.sendTo(sourceInstance, 'clientSubscribeError', {type: messageType, sid: socket.id, reason: 'no one subscribed'});
|
|
245
|
+
return false;
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
_showSubscribes(socket, type) {
|
|
@@ -1635,7 +1635,7 @@ class SocketCommands {
|
|
|
1635
1635
|
if (pos !== -1) {
|
|
1636
1636
|
this.clientSubscribes[sid][targetInstance].splice(pos, 1);
|
|
1637
1637
|
// inform instance about unsubscription
|
|
1638
|
-
this.adapter.sendTo(targetInstance, 'clientUnsubscribe', {type: [messageType], sid});
|
|
1638
|
+
this.adapter.sendTo(targetInstance, 'clientUnsubscribe', {type: [messageType], sid, reason: 'client'});
|
|
1639
1639
|
SocketCommands._fixCallback(callback, null, true);
|
|
1640
1640
|
return;
|
|
1641
1641
|
}
|
|
@@ -1658,7 +1658,7 @@ class SocketCommands {
|
|
|
1658
1658
|
this.adapter.sendTo(targetInstance, 'clientUnsubscribe', {
|
|
1659
1659
|
message: this.clientSubscribes[socketId][targetInstance],
|
|
1660
1660
|
sid: socketId,
|
|
1661
|
-
|
|
1661
|
+
reason: 'disconnect',
|
|
1662
1662
|
});
|
|
1663
1663
|
});
|
|
1664
1664
|
delete this.clientSubscribes[socketId];
|
|
@@ -230,7 +230,7 @@ class SocketCommandsAdmin extends SocketCommands {
|
|
|
230
230
|
|
|
231
231
|
systemLicenses.native.readTime = new Date().toISOString();
|
|
232
232
|
|
|
233
|
-
// save only if object changed
|
|
233
|
+
// save only if an object changed
|
|
234
234
|
return this.adapter.setForeignObjectAsync('system.licenses', systemLicenses, options)
|
|
235
235
|
.then(() => licenses);
|
|
236
236
|
})
|