Skip to content

Commit

Permalink
SSE Item State Tracking: Avoid requesting __ob__ and __v_isRef
Browse files Browse the repository at this point in the history
Fixes openhab#2530.
Regression from openhab#2489.

I wasn't able to identify the root cause, but this seems to solve the problem.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 committed Apr 20, 2024
1 parent 1232bf5 commit 571b7dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ export function allEquipmentPoints (equipment) {
* @param {String} property return only points also related to this property
*/
export function findPoints (arr, value, partial, property) {
console.debug(arr)
const points = arr.filter((p) => (partial) ? p.metadata.semantics.value.indexOf(value) === 0 : p.metadata.semantics.value === value)
if (!property) return points
console.debug('found1' + points)
return points.filter((p) => p.metadata.semantics.config.relatesTo === property)
}
3 changes: 2 additions & 1 deletion bundles/org.openhab.ui/web/src/js/store/modules/states.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const handler = (context) => {
return {
get (obj, prop) {
if (prop === '_keys') return Object.keys(context.state.itemStates)
if (prop === '__ob__') return obj.__ob__

// to avoid the Vue devtools requesting invalid items in development
if (['state', 'getters', '_vm', 'toJSON'].indexOf(prop.toString()) >= 0) return {}
if (['state', 'getters', '_vm', 'toJSON', '__v_isRef'].indexOf(prop.toString()) >= 0) return {}
if (typeof prop !== 'string') return {}

const itemName = prop
Expand Down

0 comments on commit 571b7dc

Please sign in to comment.