Habpanel doesn't update items correctly

Hello,

I have a weird issue in Habpanel. Since it’s hard to describe in few words, let me describe the steps to reproduce it:

  1. Move to a page on the drawer
  2. As soon as the page shows, click on an action item (a command, a switch, …)
  3. The item will change its state and the new state will be rendered
  4. ~1 second after, the item will render its original state, but the actual value on openhab does not change
  5. refreshing the page makes the state render correctly

Video:
video1

How ever if I do this:

  1. Move to a page on the drawer
  2. Wait 1-2 seconds
  3. Click on an action item (a command, a switch, …)
  4. The item will change its state and the new state will be rendered, as expected

Video:
video2

This happens in any page, any device, locally or remotely (cloud connector).

Has anyone experienced this kind of behaviour?

Can anyone point me any direction?

Thanks.

It’s probably worth looking at your events.log so that you have the host view of what’s going alongside your UI observations. Expect to see commands for incoming clicks, and presumably a state change at some later time.

I’ll make a guess at race condition -

Maybe this kicks HABpanel to do a big fetch of all Items state on this page? Or even all Items on any page?

Business as usual, send command to openHAB etc,

Now the response to the big fetch has arrived from the host, including the pre-clicked state of your Item.

I’ve checked out this file, and I can see only events from items. No events from UI are coming in. How can I enable them?

From the browser console log, seems you are right:

Command sent: AQS_recirculation_power=ON
openhab.service.js:182 Updating AQS_recirculation_power state from OFF to ON
openhab.service.js:40 Loaded 297 openHAB items

On the UI I activated the switch that generated the command AQS_recirculation_power=ON, the widget updated, and after the items were loaded with the outdated state…

Are you seeing any solution?

There isn’t any logging for that as such.
The UIs send REST commands targeted to the Items directly.
So what you (should) see in your events.log in response to a click-on is something like

2020-11-13 23:48:05.686 [ome.event.ItemCommandEvent] - Item 'some_item' received command ON

It doesn’t tell you the source of the command but you’ll know it by the timestamp.
All that’s just for future reference, events.log is useful to understand.

Nope.
I’ve speculated what the issue might be, but that would need some looking at the traffic to confirm.

After some analysis, I’m sure that the items are loaded on the browser, after an action is performed on UI.

Can this be an hardware limitation?

I wonder if anyone else had this kind of issue…

Thanks.

I had similar issues after OH 2.5 → OH 3.0
Clearing cache fixed it (sudo openhab-cli clean-cache )