From 7b98cf242dcc62762ca061f62761b828143e1c93 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sun, 27 Oct 2024 21:06:12 +0100 Subject: [PATCH] TASK: Catchups will only be able to access the state of the projection they are registered for A catchup doesn't have access to the full content repository, as it would allow full recursion via handle and accessing other projections state is not safe as the other projection might not be behind - the order is undefined. This will make it possible to catchup projections from outside of the cr instance as proposed here: https://github.com/neos/neos-development-collection/pull/5321 --- .../FlushSubgraphCachePoolCatchUpHookFactory.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Classes/SubgraphCachingInMemory/FlushSubgraphCachePoolCatchUpHookFactory.php b/Classes/SubgraphCachingInMemory/FlushSubgraphCachePoolCatchUpHookFactory.php index f315453..72f8bb5 100644 --- a/Classes/SubgraphCachingInMemory/FlushSubgraphCachePoolCatchUpHookFactory.php +++ b/Classes/SubgraphCachingInMemory/FlushSubgraphCachePoolCatchUpHookFactory.php @@ -4,13 +4,16 @@ namespace Neos\ContentRepositoryRegistry\SubgraphCachingInMemory; -use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\Projection\CatchUpHookFactoryInterface; use Neos\ContentRepository\Core\Projection\CatchUpHookInterface; +use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphReadModelInterface; +use Neos\ContentRepository\Core\Projection\ProjectionStateInterface; +use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; /** * Factory for {@see FlushSubgraphCachePoolCatchUpHook}, auto-registered in Settings.yaml for GraphProjection * + * @implements CatchUpHookFactoryInterface * @internal */ class FlushSubgraphCachePoolCatchUpHookFactory implements CatchUpHookFactoryInterface @@ -20,7 +23,8 @@ public function __construct( private readonly SubgraphCachePool $subgraphCachePool ) { } - public function build(ContentRepository $contentRepository): CatchUpHookInterface + + public function build(ContentRepositoryId $contentRepositoryId, ProjectionStateInterface $projectionState): CatchUpHookInterface { return new FlushSubgraphCachePoolCatchUpHook($this->subgraphCachePool); }