Currently a component needs to retrieve all state variables to figure out the details of the provided variables. This is not optimal as
1) its bad for performance when filtering for suiting components, see #761750: Add support for rules actions
2) there are nasty cache re-building issues with it

We need to improve it such that this info is calculated on pre-save and available as is when components are loaded.

Comments

fago’s picture

Component: Rules Core » Rules Engine
Status: Active » Fixed

>We need to improve it such that this info is calculated on pre-save and available as is when components are loaded.

That won't work generally, as Rules could be created or imported in default hooks. Thus, the best way to easily fix this I come up with is limiting components to be able to only return variables which are specified in the component variables.

I've implemented that + I also improved the UI, such that it is possible to do that via the UI too. Additionally, I added a default configuration to the test cases that does so. Any feedback, in particularly on the UI would be appreciated. For now, I've just gone ahead and committed it, so we have something working.

Note that this is now dropping support for providing back variables which stem from an action inside the component. As this case triggered the cache re-building issues when the component would have been used via an action, it didn't work as it should. So I assume no one is using it that way now - so dropping support for that at this point should be fine.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.