@iobroker/socket-classes 0.4.8 → 0.4.11
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 +7 -1
- package/lib/socketCommands.js +18 -6
- package/lib/socketCommon.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,7 +69,13 @@ io.close();
|
|
|
69
69
|
-->
|
|
70
70
|
|
|
71
71
|
## Changelog
|
|
72
|
-
### 0.4.
|
|
72
|
+
### 0.4.11 (2022-07-05)
|
|
73
|
+
* (bluefox) Corrected log transportation
|
|
74
|
+
|
|
75
|
+
### 0.4.10 (2022-06-22)
|
|
76
|
+
* (bluefox) Corrected getAdapterInstances
|
|
77
|
+
|
|
78
|
+
### 0.4.9 (2022-06-20)
|
|
73
79
|
* (bluefox) Do not show error with failed authentication
|
|
74
80
|
|
|
75
81
|
### 0.4.7 (2022-06-20)
|
package/lib/socketCommands.js
CHANGED
|
@@ -371,7 +371,10 @@ class SocketCommands {
|
|
|
371
371
|
} else if (type === 'objectChange') {
|
|
372
372
|
this.adapter.unsubscribeForeignObjects && this.adapter.unsubscribeForeignObjects(pattern);
|
|
373
373
|
} else if (type === 'log') {
|
|
374
|
-
this.adapter.requireLog && this.
|
|
374
|
+
if (this.adapter.requireLog && this.logEnabled) {
|
|
375
|
+
this.logEnabled = false;
|
|
376
|
+
this.adapter.requireLog(false);
|
|
377
|
+
}
|
|
375
378
|
} else if (type === 'fileChange') {
|
|
376
379
|
this.adapter.unsubscribeForeignFiles && this.adapter.unsubscribeForeignFiles(pattern, patternFile);
|
|
377
380
|
}
|
|
@@ -388,7 +391,10 @@ class SocketCommands {
|
|
|
388
391
|
this.adapter.unsubscribeForeignObjects && this.adapter.unsubscribeForeignObjects(pattern);
|
|
389
392
|
} else if (type === 'log') {
|
|
390
393
|
//console.log((socket._name || socket.id) + ' requireLog false');
|
|
391
|
-
this.adapter.requireLog && this.
|
|
394
|
+
if (this.adapter.requireLog && this.logEnabled) {
|
|
395
|
+
this.logEnabled = false;
|
|
396
|
+
this.adapter.requireLog(false);
|
|
397
|
+
}
|
|
392
398
|
} else if (type === 'fileChange') {
|
|
393
399
|
const [id, fileName] = pattern.split('####');
|
|
394
400
|
this.adapter.unsubscribeForeignFiles && this.adapter.unsubscribeForeignFiles(id, fileName);
|
|
@@ -422,7 +428,10 @@ class SocketCommands {
|
|
|
422
428
|
} else if (type === 'objectChange') {
|
|
423
429
|
this.adapter.subscribeForeignObjects && this.adapter.subscribeForeignObjects(pattern);
|
|
424
430
|
} else if (type === 'log') {
|
|
425
|
-
this.adapter.requireLog && this.
|
|
431
|
+
if (this.adapter.requireLog && !this.logEnabled) {
|
|
432
|
+
this.logEnabled = true;
|
|
433
|
+
this.adapter.requireLog(true);
|
|
434
|
+
}
|
|
426
435
|
}
|
|
427
436
|
} else {
|
|
428
437
|
this.subscribes[type][pattern]++;
|
|
@@ -454,7 +463,10 @@ class SocketCommands {
|
|
|
454
463
|
} else if (type === 'objectChange') {
|
|
455
464
|
this.adapter.unsubscribeForeignObjects && this.adapter.unsubscribeForeignObjects(pattern);
|
|
456
465
|
} else if (type === 'log') {
|
|
457
|
-
this.adapter.requireLog && this.
|
|
466
|
+
if (this.adapter.requireLog && !this.logEnabled) {
|
|
467
|
+
this.logEnabled = true;
|
|
468
|
+
this.adapter.requireLog(true);
|
|
469
|
+
}
|
|
458
470
|
}
|
|
459
471
|
delete this.subscribes[type][pattern];
|
|
460
472
|
}
|
|
@@ -885,9 +897,9 @@ class SocketCommands {
|
|
|
885
897
|
this.commands['getAdapterInstances'] = (socket, adapterName, callback) => {
|
|
886
898
|
if (typeof callback === 'function') {
|
|
887
899
|
if (this._checkPermissions(socket, 'getObject', callback)) {
|
|
888
|
-
let _adapterName = adapterName
|
|
900
|
+
let _adapterName = adapterName !== undefined && adapterName !== null ? adapterName : this.adapterName || '';
|
|
889
901
|
if (_adapterName) {
|
|
890
|
-
_adapterName += '.'
|
|
902
|
+
_adapterName += '.';
|
|
891
903
|
}
|
|
892
904
|
this.adapter.getObjectView('system', 'instance',
|
|
893
905
|
{startkey: `system.adapter.${_adapterName}`, endkey: `system.adapter.${_adapterName}\u9999`},
|
package/lib/socketCommon.js
CHANGED
|
@@ -108,7 +108,9 @@ class SocketCommon {
|
|
|
108
108
|
this.server.on('error', (error, details) => {
|
|
109
109
|
// ignore "failed connection" as it already shown
|
|
110
110
|
if (!error || !error.message || !error.message.includes('failed connection')) {
|
|
111
|
-
if (error && error.message && error.message.includes('authentication failed')
|
|
111
|
+
if ((error && error.message && error.message.includes('authentication failed') ||
|
|
112
|
+
(details && details.includes('authentication failed')))
|
|
113
|
+
) {
|
|
112
114
|
this.adapter.log.debug(`Error: ${(error && error.message) || JSON.stringify(error)}${details ? ' - ' + details : ''}`);
|
|
113
115
|
} else {
|
|
114
116
|
this.adapter.log.error(`Error: ${(error && error.message) || JSON.stringify(error)}${details ? ' - ' + details : ''}`);
|