diff --git a/lib/db.coffee b/lib/db.coffee index ee12d7d..d77fdaa 100644 --- a/lib/db.coffee +++ b/lib/db.coffee @@ -333,8 +333,9 @@ fetchDevice = (id, timestamp, patterns, callback) -> {object: [timestamp, 0], writable: [timestamp, 0], value: [timestamp, [v, 'xsd:string']]}]) delete device[k] when '_tags' - res.push([['Tags'], timestamp, - {object: [timestamp, 1], writable: [timestamp, 0]}]) + if v.length + res.push([['Tags'], timestamp, + {object: [timestamp, 1], writable: [timestamp, 0]}]) for t in v t = t.replace(/[^a-zA-Z0-9\-]+/g, '_') res.push([['Tags', t], timestamp, diff --git a/lib/session.coffee b/lib/session.coffee index 3806b47..2413391 100644 --- a/lib/session.coffee +++ b/lib/session.coffee @@ -698,13 +698,6 @@ rpcRequest = (sessionContext, _declarations, callback) -> toClear = device.set(sessionContext.deviceData, p, timestamp, {object: [timestamp, false], writable: [timestamp, true], value: [timestamp, [true, 'xsd:boolean']]}, toClear) else if c? and not v toClear = device.set(sessionContext.deviceData, p, timestamp, toClear) - noMoreTags = true - for p in sessionContext.deviceData.paths.find(['Tags', '*'], false, true) - if sessionContext.deviceData.attributes.has(p) - noMoreTags = false - break - if noMoreTags - toClear = device.set(sessionContext.deviceData, ['Tags'], timestamp, null, toClear) ) # Downloads