-
-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix thing reloading from things file #3526
Conversation
It was found that things from textual configuration are not properly updated if changes are only made in configuration or label of a channel. The reason is that for equality only uid and accepted item-type where checked. Signed-off-by: Jan N. Klug <github@klug.nrw>
I‘ve tested this, and it is very weird: sometimes when you change channels, the thing is updated, but sometimes the thing is not updated. |
If you enable debug logging for
|
No,
|
Ok, so for some reason the code still thinks they are equals even if they are not. Do you have something that always or at least mostly fails (i.e. editing the label fails, editing the configuration works)? Can you share the |
It seems like it mostly happens when:
Here the relavent part of my
|
I think I found it. However, I'm not 100% if my fix is correct, it's in the XTend code and that is always a mystery for me. Currently testing if it works for me. |
Signed-off-by: Jan N. Klug <github@klug.nrw>
Please check this version, it also contains an updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine, thanks for the fix!
Great finding, thanks for this fix. This is something that has annoyed me for a long time, but never took the time to reproduce or investigate this further. I just had this feeling that it did not work correctly, as it usually happened for me during tests where I was changing configuration back and forth. |
bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/Channel.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jan N. Klug <github@klug.nrw>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/text-configuration-loading-after-change/146244/5 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/come-back-and-learn-how-to-use-file-based-configuration/147067/15 |
It was found that things from textual configuration are not properly updated if changes are only made in configuration or label of a channel. The reason is that for equality only uid and accepted item-type where checked. Signed-off-by: Jan N. Klug <github@klug.nrw> GitOrigin-RevId: 016828c
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
Fixes #3527
It was found that things from textual configuration are not properly updated if changes are only made in configuration or label of a channel. The reason is that for assuming equality only uid and accepted item-type of the channel were checked. This is obviously wrong and also confusing because for the thing itself configuration and other fields are also compared.
Another bug in the
GenericThingProvider
: The things are cached in the provider to determine changes. However, this list was never updated, resulting in changes back to the first version (v1 -> v2 -> v1) not resulting in an update notification, because the new thing and the cached thing are equal.