fix: #3627038 HookCollectorKeyValueWritePass can leave the event dispatcher...

fix: #3627038 HookCollectorKeyValueWritePass can leave the event dispatcher without listeners during database updates

HookCollectorKeyValueWritePass gets the keyvalue and cache.bootstrap services while the container compiles. This also creates the dependencies of these services. If a dependency needs the event dispatcher, the event dispatcher exists before RegisterEventSubscribersPass adds the listeners.

The update kernel and kernel tests use the container builder as their container. Thus, no event subscriber runs, and a router rebuild writes 0 routes.

The pass now records the initialized services before it starts. At the end, it removes the instances that it created. The container creates them again from the complete definitions.

The new kernel test enables a test module that decorates cache_factory with a service that needs current_user.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

Closes #3627038

Merge request reports

Loading
Loading