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
Update ActionService and ThingActions classes in Xtext cache #1714
Conversation
Xtext uses a cache for looking up classes when rules are run. It also adds a null class value to this cache when a class is not found. Once a value has entered the cache it will not be updated. This causes the cache to return the wrong class (or the null value) when calling static methods on ActionService and ThingActions classes that were added/updated. With the changes in this PR Xtext will be configured to use a custom cache that updates the ActionService and ThingActions class references. The PR also has a fix for the AnnotatedThingActionModuleTypeProvider not properly sending ModuleType removed events when all ThingActions registrations have been removed. Fixes openhab#1265 Fixes openhab#1694 Signed-off-by: Wouter Born <github@maindrain.net>
* Remove proxy workarounds * Move ThingActions and a few other classes into the internal package * Use more consistent action labels/descriptions Related to: * openhab/openhab-core#1714 * openhab/openhab-core#1639 Signed-off-by: Wouter Born <github@maindrain.net>
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.
Wow, looks like pure magic and I do not claim to understand all details what you did there and even less how you have figure out to do it - but the result is fantastic 🎉 .
* Remove proxy workarounds * Move ThingActions and a few other classes into the internal package * Use more consistent action labels/descriptions Related to: * openhab/openhab-core#1714 * openhab/openhab-core#1639 Signed-off-by: Wouter Born <github@maindrain.net>
@wborn Thanks again for this implementation. But I am afraid is is not the final solution. I still see an exception when updating a binding manually in the
|
I think there is still one other issue unrelated to this cache. I've also sometimes seen that if you would install a binding the So when that occurs the cache entry is probably also not updated. You can enable debug logging on |
I removed the
|
Are you using DSL rules or some other scripting language? |
These test were done with DSL rules. Created via UI. |
* Remove proxy workarounds * Move ThingActions and a few other classes into the internal package * Use more consistent action labels/descriptions Related to: * openhab/openhab-core#1714 * openhab/openhab-core#1639
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/tr-064-thing-action-phonebooklookup-not-working/113101/38 |
* Remove proxy workarounds * Move ThingActions and a few other classes into the internal package * Use more consistent action labels/descriptions Related to: * openhab/openhab-core#1714 * openhab/openhab-core#1639 Signed-off-by: Wouter Born <github@maindrain.net>
…#1714) Xtext uses a cache for looking up classes when rules are run. It also adds a null class value to this cache when a class is not found. Once a value has entered the cache it will not be updated. This causes the cache to return the wrong class (or the null value) when calling static methods on ActionService and ThingActions classes that were added/updated. With the changes in this PR Xtext will be configured to use a custom cache that updates the ActionService and ThingActions class references. The PR also has a fix for the AnnotatedThingActionModuleTypeProvider not properly sending ModuleType removed events when all ThingActions registrations have been removed. Fixes openhab#1265 Fixes openhab#1694 Signed-off-by: Wouter Born <github@maindrain.net> GitOrigin-RevId: 0d1a15e
Xtext uses a cache for looking up classes when rules are run.
It also adds a null class value to this cache when a class is not found.
Once a value has entered the cache it will not be updated.
This causes the cache to return the wrong class (or the null value) when
calling static methods on ActionService and ThingActions classes that
were added/updated.
With the changes in this PR Xtext will be configured to use a custom cache
that updates the ActionService and ThingActions class references.
The PR also has a fix for the AnnotatedThingActionModuleTypeProvider not
properly sending ModuleType removed events when all ThingActions
registrations have been removed.
Fixes #1265
Fixes #1694