openhab / openhab-webui

Web UIs of openHAB
Eclipse Public License 2.0
214 stars 235 forks source link

Detect loops in model #797

Open MrMontesa opened 3 years ago

MrMontesa commented 3 years ago

The problem

Suddenly the Model page was not loading any longer. The loading circle never came to an end displaying the page. This occured after lots of edits in my items. All done via WebUI. After some digging I found others had the same issue: https://community.openhab.org/t/solved-oh3-issue-model-page-endless-loading-maximum-call-stack-size-exceeded-in-app-js/111320/28 Seems like we possibly created a dependency loop with adding a group to a group with member of itself. Since all maintenance was done on the items page, I wasnt able to track down which config change, broke the setup. I had to revert about 30 item updates until the page suddenly loaded again.

Expected behavior

Ideally Main UI should recognize a loop and make sure to not create such config. Stop/spit error/etc

Steps to reproduce

It happened to me twice already, but cannot safely confirm how to re-create the issue. Most likely a loop within group dependencies. Will check if someone from the community can add info.

Your environment

  version: 3.0.0
  buildString: Release Build
locale: en_DE
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 11.0.9.1
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.43+55-CA
  osName: Linux
  osVersion: 3.16.0-11-amd64
  osArchitecture: amd64
  availableProcessors: 4
  freeMemory: 243514176
  totalMemory: 441450496
bindings:
  - astro
  - darksky
  - exec
  - harmonyhub
  - homematic
  - http
  - hue
  - mqtt
  - nanoleaf
  - netatmo
  - network
  - ntp
  - nuki
  - shelly
  - sonos
  - tankerkoenig
  - telegram
  - tr064
  - wled
  - zwave
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: false
    windows: true
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: windows
    pixelRatio: 1
    prefersColorScheme: light
  isSecureContext: false
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: 8
    language: en-US
    languages:
      - en-US
      - de-DE
      - de
      - en
    onLine: true
    platform: Win32
  screen:
    width: 1920
    height: 1080
    colorDepth: 24
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: light
    filled: true
    pageTransitionAnimation: default
    bars: filled
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
  userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
timestamp: 2021-01-13T08:58:44.778Z

Let me know if you need more/other details. Thanks much

tophee commented 2 years ago

Until we have this feature, perhaps the webpage could issue some hint that there might be circularity going on so that users don’t just see the “loading” circle but get a pointer to what is going on?