-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
[cache] Reimplementation to use the new core caches #191
[cache] Reimplementation to use the new core caches #191
Conversation
... while keeping backward compatibility with older openHAB versions. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@digitaldan @jpg0 @rkoshak Can you please review? This is urgent, because we should get this merged before the sixth milestome and the feature freeze comes on Sunday evening. You only need to review |
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
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.
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 assuming either we can't get at the ruleUID or filename or we add that to the log.
*/ | ||
const put = function (key, value) { | ||
return cache.put(key, value); | ||
const logDeprecationWarning = (funcName) => { |
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.
Is there any way we can get the ruleUID or filename to log out as part of this warning? At first some users may get hundreds or these warnings and knowing which rules they are coming from can help in prioritization in dealing with them.
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.
By using console.warn
instead of log.warn
we are logging to the logger name of the script/rule, so for file-based script to org.openhab.automation.script.file.filename.js
and for UI to org.openhab.automation.script.ui.ruleUid
.
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
@digitaldan @jpg0 |
LGTM! |
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
Fixes #184.
Reference openhab/openhab-core#2887.
Reference openhab/openhab-core#3204.
Description
This implements:
cache
:private
property tocache
to allow access to the private cacheshared
property tocache
to allow access to the shared cacheUnit test is updated to test the
JSCache
class instead of the exported methods of thecache
namespace, because testing the exported methods for each case is quite complex and given the fact that the compatibility layer will be removed at some time, I decided to not take that effort.Testing
The functionality of
JSCache
is tested by the Jest unit test, the exports are tested by me.