From f9a03a26dbb568411ac89127312ebcbbd92f6731 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:08:08 +0100 Subject: [PATCH] TASK: Introduce test that we cannot roll-back setup Similarly to that doctrine migrations (`flow doctrine:migrate`) are also cannot be rollback in case of an error So we cannot wrap projection->setUp in transaction and errors (like in a migration) will be directly commited. Thus, it must be acted with care. --- Classes/Subscription/Engine/SubscriptionEngine.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Subscription/Engine/SubscriptionEngine.php b/Classes/Subscription/Engine/SubscriptionEngine.php index 32dfed4..3b3c259 100644 --- a/Classes/Subscription/Engine/SubscriptionEngine.php +++ b/Classes/Subscription/Engine/SubscriptionEngine.php @@ -60,7 +60,8 @@ public function setup(SubscriptionEngineCriteria|null $criteria = null): Result SubscriptionStatus::ACTIVE ]))); if ($subscriptions->isEmpty()) { - $this->logger?->info('Subscription Engine: No subscriptions found.'); // todo not happy? Because there must be at least the content graph?!! + // should not happen as this means the contentGraph is unavailable, see status information. + $this->logger?->info('Subscription Engine: No subscriptions found.'); return Result::success(); } $errors = []; @@ -211,7 +212,6 @@ private function setupSubscription(Subscription $subscription): ?Error try { $subscriber->projection->setUp(); } catch (\Throwable $e) { - // todo wrap in savepoint to ensure error do not mess up the projection? $this->logger?->error(sprintf('Subscription Engine: Subscriber "%s" for "%s" has an error in the setup method: %s', $subscriber::class, $subscription->id->value, $e->getMessage())); $this->subscriptionStore->update( $subscription->id,