@iobroker/db-objects-file
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -24,3 +24,18 @@ /** | ||
settings.autoConnect = false; // delay Client connection to when we need it | ||
// hack around testing problem where subscribe was called before connect | ||
// Should be removed for a later release | ||
const origConnected = settings.connected; | ||
settings.connected = () => { | ||
this.clientConnected = true; | ||
if (Array.isArray(this.storedSubscribes) && this.storedSubscribes.length) { | ||
this.log.warn(`Replay ${this.storedSubscribes.length} subscription calls for Objects Server that were done before the client was connected initially`); | ||
this.storedSubscribes.forEach((s => this.subscribe(s.pattern, s.options, s.callback))); | ||
this.storedSubscribes = []; | ||
} | ||
origConnected(); | ||
}; | ||
super(settings); | ||
this.clientConnected = false; | ||
this.storedSubscribes = []; | ||
@@ -55,4 +70,11 @@ const serverSettings = { | ||
} | ||
subscribe(pattern, options, callback) { | ||
if (!this.clientConnected) { | ||
this.storedSubscribes.push({pattern, options, callback}); // we ignore the promise return because not used for this testing issue we work around here | ||
} else { | ||
return super.subscribe(pattern, options, callback); | ||
} | ||
} | ||
} | ||
module.exports = ObjectsInMemoryServerClass; |
{ | ||
"name": "@iobroker/db-objects-file", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"engines": { | ||
@@ -35,3 +35,3 @@ "node": ">=10.0.0" | ||
}, | ||
"gitHead": "3e3b5557fb118b961fb8cfba08c69687d9af8617" | ||
"gitHead": "aed94e7b4a043dec470c45b0b03cef9f451efe9c" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
83071
1591