Problem: users need to clear caches (thereby rebuilding the service container) before a reaction rule will ever be executed. They might forget that and wonder why their rules never get executed.

We could rebuild the container whenever a rule is saved, but seems expensive and makes the UI slow. Maybe there is another way to update the list of events in the container without rebuilding?

Comments

klausi created an issue. See original summary.

fago’s picture

Maybe we can kick the process of in the backend? I think we'll have to do that automatically - that's really the expectation that you have when you edit something. Maybe it's fine though once we moved our UI to one-time save operation and an interim object in temp-store as views does, as you'll end up with less saves?

klausi’s picture

Now that we have #2649500: Switch UI logic to use a temp-store rules are not saved that often.

Yes, we can trigger a container rebuild when the form is submitted in the UI. We can even do an optimisation: if our generic event subscriber in Rules is already registered to the event in the kernel/container then we don't need to rebuild.

fago’s picture

Yep, we definitely should do that optimization and check whether there were already some rules listening on that event.

fago’s picture

Issue tags: +Contributor

Tagging as (advanced) contributor task.

vasi1186’s picture

Assigned: Unassigned » vasi1186
vasi1186’s picture

Status: Active » Needs review

Hi,
I created a pull request here: https://github.com/fago/rules/pull/364

vasi1186’s picture

Assigned: vasi1186 » Unassigned
dasjo’s picture

Status: Needs review » Needs work

see comments in the PR

vasi1186’s picture

Status: Needs work » Needs review

The issues should be fixed now.

fago’s picture

Status: Needs review » Fixed

Thanks, good work - committed!

  • fago committed f28b4ee on 8.x-3.x authored by vasi1186
    Issue #2648284 by vasi1186: A service container rebuild is required when...
fago’s picture

oh, I just figured that we are doing this at the wrong place. The form is not the right place as this will miss any rules that get synced via CMI and/or are created via API. But moving this to a config entity crud event should be fine - once done so we should be able to remove the manual kernel rebuilds from EventIntegrationTest also.

-> created follow-up #2659990: Creating reaction rules via API does not trigger container rebuilds

Status: Fixed » Closed (fixed)

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