openHAB 4.0 SNAPSHOT discussion

I wanted to say that for the first time in a long while I’m usually getting a completely clean start. :partying_face: Great work to everyone!

However, I’ve been seeing something odd the past few snapshots which I’m pretty certain is a timing issue. I’m still investigating and need to confirm this but it seems that two out of every three starts of OH, any rules that trigger soon after runlevel 40.

This can be because of an event (e.g. an instance of Thing Status Reporting [4.0.0.0;4.1.0.0) triggering because of the Things coming online, Items which start to receive events before runlevel 80, or an explicit runlevel rule like Delay Start [4.0.0.0;4.1.0.0)).

When this occurs, I’ll see

20│2023-03-02 10:35:25.924 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'rules_delayed' failed: <eval>:1:4 Expected ident but found {│
20│var {helpers} = require('openhab_rules_tools');                                                                                                                         │
20│    ^ in <eval> at line number 1 at column number 4                                                                                                                     │

for every rule that runs during this period. It’s always that first line of the rule it complains about. Once runlevel 100 is reached (maybe as early as 80, I’m adding stuff to verify) the rules work just fine.

It’s not the worse thing in the world, though it does break my Delay Startup rule which is supposed to turn off some rules that shouldn’t fire until start is closer to complete.

I’m going to try to narrow down the timing a little better but reporting the initial behavior in case someone can say “Oh I know what’s going on!”