thingsboard / thingsboard

Open-source IoT Platform - Device management, data collection, processing and visualization.
https://thingsboard.io
Apache License 2.0
17.55k stars 5.19k forks source link

Breaking changes in v3.8.1 from v3.7.0 #11926

Open VazgenGishyan opened 2 weeks ago

VazgenGishyan commented 2 weeks ago

Hi, After the version update to 3.8.1, I have encountered the following issues:

When importing a new dashboard via JSON, the required widgets are no longer imported automatically. Screenshot 2024-10-22 155518

When changing the state in the dashboard, the onDestroy function is no longer called for widgets from the previous state.

idealissst commented 1 week ago

Hi, Did you try to import the Dashboard in the same ThingsBoard you exported the Dashboard or another one? Does the Dashboard in the first place work correctly, and is ThingsBoard version 3.8.1? Also, I wanted to ask if you use custom action or custom widgets,

VazgenGishyan commented 1 week ago

Hi,

No, I imported the dashboard into another ThingsBoard. Yes, it worked correctly in the original one, which was running version 3.7.0. Additionally, I am using custom widgets.

idealissst commented 1 week ago

Hello, The thing is, ThingsBoard was never able to import a dashboard with custom widgets. If you want to import the dashboard correctly, you have to import custom widgets, too, because the dashboard doesn't import custom elements when importing. This could be the root of the error.

VazgenGishyan commented 1 week ago

Hi,

As far as I remember, ThingsBoard used to automatically import the required widgets along with the dashboard.

In any case, I have now manually imported all the widgets, and everything is working correctly. However, the onDestroy function is still not being called for widgets in the previous state when the state changes.

supotsaea2504 commented 1 week ago

I facing same problem import custom widget from 3.8.0 to 3.7.0 and vise versa.

VazgenGishyan commented 1 week ago

Hi,

I hope this helps: I found that the transition between states works correctly only for the Layout Tablet (sm) range (min 600px – max 959px).

For all other layouts, I encounter warnings. Screenshot 2024-10-22 155518

However, if I reload the page, everything starts working normally.

idealissst commented 6 days ago

Hi, The framework or environment may not automatically trigger onDestroy when widgets are replaced or state changes. ThingsBoard, for instance, may cache or reuse widget instances for efficiency, which could prevent the onDestroy method from being called as expected. Try to clear cache, please.

VazgenGishyan commented 20 hours ago

Hi, I have tested the issue with cleared caches and also in incognito mode, but unfortunately, I am still experiencing the same problem.

VazgenGishyan commented 20 hours ago

I apologize in advance for any confusion, but I think the issue may not be that onDestroy is not being called. Instead, it seems that new widgets are not being placed in the correct location. However, on the Layout sm version, or after refreshing the page, everything works as expected.