-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Main UI rule triggers when click edit rule if trigger is set to "when system has reached level 70" #2027
Comments
To be clear, with the behavior of system started/runlevel triggers in OH 4, the rule will trigger when it's saved. That's expected and correct behavior. However, merely clicking on the rule or a script action should not trigger the rule. Such rule should only be triggered on saving the rule. That's the bug here. The rule triggers even without changing anything meaning the rule should not be reloaded and therefore should not trigger. |
Thanks, see what you mean and makes sense. Updated accordingly. |
The 20 sec issue is known. See openhab/openhab-addons#15600. There is some evidence that using a 64-bit Java will reduce that initial run of the rule down to 2 seconds. |
the point is not in 20 seconds, but in the fact that the rule is launched instead of editing |
The problem is, that the script code editor is opened in a new page, before which the UI saves the rule. I guess the only solution would be to make the script editing happening in a way that the rule does not need to be saved. |
Could it keep track of whether anything has changed (e.g. triggers) and only save if there is something to save? Even better ask if unsaved changes should be saved before opening the code editor. |
I thought about this issue a bit, and yes, this should be possible. |
Fixes openhab#2027. When a script inside a rule was opened, the UI always saved the rule before navigating to the script editor. With this fix, the rule is only saved if there is a change to save. If the rule hasn't been changed, no save request is performed. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
#2203) Fixes #2027. When a script inside a rule was opened, the UI always saved the rule before navigating to the script editor. With this fix, the rule is only saved if there is a change to save. If the rule hasn't been changed, no save request is performed. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
The problem
When I'm editing rules in the Main-UI normally when you click on "Execute a given script" it opens the script so you can edit it. This behaviour is different when the rule has the trigger "when the system has reached level 70". In that case it runs the rule and you need to click several times to be able to open the scrip to edit,
when you save it, it runs the rule againExpected behavior
When editing
/savinga rule it should not start the rule, only when saving or manually starting the rule.Steps to reproduce
Your environment
Browser console
Browser network traffic
Additional information
The text was updated successfully, but these errors were encountered: