Comparing version 2.1.15 to 2.1.17
@@ -78,3 +78,3 @@ "use strict"; | ||
} | ||
if (this._wsConnection._opened) { | ||
if (new Date().getTime() - this._wsConnection._openTs > 1000) { // has been connected for more than 1 second | ||
this._wsDelay = 1; | ||
@@ -81,0 +81,0 @@ this.initWebsocket(false); |
@@ -24,4 +24,4 @@ import { ClientLink, Connection, ConnectionChannel } from '../common/interfaces'; | ||
requireSend(): void; | ||
_opened: boolean; | ||
get opened(): boolean; | ||
_openTs: number; | ||
get openTs(): number; | ||
_onOpen: (e: Event) => void; | ||
@@ -28,0 +28,0 @@ _msgCommand: { |
@@ -36,6 +36,6 @@ "use strict"; | ||
}; | ||
this._opened = false; | ||
this._openTs = Infinity; | ||
this._onOpen = (e) => { | ||
logger.trace('Connected'); | ||
this._opened = true; | ||
this._openTs = new Date().getTime(); | ||
if (this.onConnect != null) { | ||
@@ -203,4 +203,4 @@ this.onConnect(); | ||
} | ||
get opened() { | ||
return this._opened; | ||
get openTs() { | ||
return this._openTs; | ||
} | ||
@@ -207,0 +207,0 @@ /// add server command, will be called only when used as server connection |
@@ -19,2 +19,3 @@ import { NodeQueryStructure } from './query-structure'; | ||
filter: QueryFilter; | ||
exists: boolean; | ||
valueMode?: 'live' | 'snapshot'; | ||
@@ -21,0 +22,0 @@ childrenMode?: 'live' | 'snapshot'; |
@@ -25,2 +25,4 @@ "use strict"; | ||
super(null, parent.onAllCancel, null, true); | ||
// used on named child query. parent should know if children node exist or not | ||
this.exists = true; | ||
// fixed children will stay in memory even when parent node is filtered out | ||
@@ -47,3 +49,3 @@ // once fixed children is started, they will keep running until parent is destroyed | ||
for (let [key, query] of this.fixedChildren) { | ||
if (query._filterMatched && query._value && !query.disconnected) { | ||
if (query.exists && query._filterMatched && query._value && !query.disconnected) { | ||
children.set(key, query._value); | ||
@@ -139,2 +141,9 @@ } | ||
} | ||
for (let [name, child] of this.fixedChildren) { | ||
let exists = update.node.children.has(name); | ||
if (exists !== child.exists) { | ||
child.exists = exists; | ||
this.scheduleOutput(); | ||
} | ||
} | ||
this.setListReady(true); | ||
@@ -141,0 +150,0 @@ }; |
@@ -208,3 +208,2 @@ "use strict"; | ||
invoke(m) { | ||
var _a; | ||
let path = node_1.Path.getValidNodePath(m['path']); | ||
@@ -214,3 +213,3 @@ if (path != null && path.isAbsolute) { | ||
let parentNode = this.nodeProvider.getNode(path.parentPath); | ||
let actionNode = ((_a = parentNode) === null || _a === void 0 ? void 0 : _a.getChild(path.name)) || this.nodeProvider.getNode(path.path); | ||
let actionNode = (parentNode === null || parentNode === void 0 ? void 0 : parentNode.getChild(path.name)) || this.nodeProvider.getNode(path.path); | ||
if (actionNode == null) { | ||
@@ -217,0 +216,0 @@ this.closeResponse(m['rid'], null, interfaces_1.DsError.NOT_IMPLEMENTED); |
{ | ||
"name": "dslink", | ||
"license": "Apache-2.0", | ||
"version": "2.1.15", | ||
"version": "2.1.17", | ||
"main": "js/node.js", | ||
@@ -16,36 +16,39 @@ "repository": { | ||
"@types/base64-js": "^1.2.5", | ||
"@types/chai": "^4.2.5", | ||
"@types/karma": "^3.0.4", | ||
"@types/mocha": "^5.2.7", | ||
"@types/chai": "^4.2.11", | ||
"@types/karma": "^4.4.0", | ||
"@types/mocha": "^7.0.2", | ||
"@types/moment-timezone": "^0.5.12", | ||
"@types/msgpack-lite": "^0.1.7", | ||
"@types/node": "^12.12.11", | ||
"@types/react": "^16.9.11", | ||
"@types/node": "^13.9.1", | ||
"@types/react": "^16.9.23", | ||
"@types/react-dom": "^16.9.5", | ||
"@types/ws": "^6.0.3", | ||
"@types/yargs": "^13.0.3", | ||
"@types/ws": "^7.2.2", | ||
"@types/yargs": "^15.0.4", | ||
"babel-core": "^6.26.3", | ||
"babel-preset-env": "^1.7.0", | ||
"chai": "^4.2.0", | ||
"coveralls": "^3.0.7", | ||
"mocha": "^6.2.2", | ||
"nyc": "^14.1.1", | ||
"coveralls": "^3.0.9", | ||
"mocha": "^7.1.1", | ||
"nyc": "^15.0.0", | ||
"parcel-bundler": "^1.12.4", | ||
"prettier": "^1.19.1", | ||
"react": "^16.10.2", | ||
"react-dom": "^16.10.2", | ||
"ts-node": "^8.5.2", | ||
"tslint": "^5.20.1", | ||
"typedoc": "^0.15.3", | ||
"typescript": "^3.7.2" | ||
"react": "^16.13.0", | ||
"react-dom": "^16.13.0", | ||
"ts-node": "^8.6.2", | ||
"tslint": "^6.1.0", | ||
"typedoc": "^0.17.1", | ||
"typescript": "^3.8.3" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.19.0", | ||
"axios": "^0.19.2", | ||
"base64-js": "^1.3.1", | ||
"denque": "^1.4.1", | ||
"moment-timezone": "^0.5.27", | ||
"moment-timezone": "^0.5.28", | ||
"msgpack-lite": "^0.1.26", | ||
"ws": "^7.2.1", | ||
"yargs": "^15.0.2" | ||
"ws": "^7.2.3", | ||
"yargs": "^15.3.1" | ||
}, | ||
"resolutions": { | ||
"**/minimist": "^1.2.5" | ||
}, | ||
"scripts": { | ||
@@ -52,0 +55,0 @@ "js-example": "parcel example/browser/basic.html --out-dir temp --open --no-source-maps ", |
@@ -109,3 +109,3 @@ /// a client link for both http and ws | ||
} | ||
if (this._wsConnection._opened) { | ||
if (new Date().getTime() - this._wsConnection._openTs > 1000) { // has been connected for more than 1 second | ||
this._wsDelay = 1; | ||
@@ -112,0 +112,0 @@ this.initWebsocket(false); |
@@ -105,5 +105,5 @@ import { | ||
_opened: boolean = false; | ||
get opened(): boolean { | ||
return this._opened; | ||
_openTs = Infinity; | ||
get openTs(): number { | ||
return this._openTs; | ||
} | ||
@@ -113,3 +113,3 @@ | ||
logger.trace('Connected'); | ||
this._opened = true; | ||
this._openTs = new Date().getTime(); | ||
if (this.onConnect != null) { | ||
@@ -116,0 +116,0 @@ this.onConnect(); |
@@ -39,2 +39,5 @@ import {NodeQueryStructure} from './query-structure'; | ||
// used on named child query. parent should know if children node exist or not | ||
exists = true; | ||
valueMode?: 'live' | 'snapshot'; | ||
@@ -144,3 +147,3 @@ childrenMode?: 'live' | 'snapshot'; | ||
for (let [key, query] of this.fixedChildren) { | ||
if (query._filterMatched && query._value && !query.disconnected) { | ||
if (query.exists && query._filterMatched && query._value && !query.disconnected) { | ||
children.set(key, query._value); | ||
@@ -331,2 +334,9 @@ } | ||
} | ||
for (let [name, child] of this.fixedChildren) { | ||
let exists = update.node.children.has(name); | ||
if (exists !== child.exists) { | ||
child.exists = exists; | ||
this.scheduleOutput(); | ||
} | ||
} | ||
this.setListReady(true); | ||
@@ -333,0 +343,0 @@ }; |
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
567670
17542
Updatedaxios@^0.19.2
Updatedmoment-timezone@^0.5.28
Updatedws@^7.2.3
Updatedyargs@^15.3.1