From 11c8b852095a966bbeae092be2d37dfa05798a43 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Thu, 11 Jun 2026 16:49:04 +0200 Subject: [PATCH] Fix missing reset of `ContentApi` and `StoryblokIdSlugMapper`. --- CHANGELOG.md | 6 ++++++ src/Adapter/AbstractStoryblokAdapter.php | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7be4431..915c385 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +5.2.6 +===== + +* (bug) Fix missing reset of `ContentApi` and `StoryblokIdSlugMapper`. + + 5.2.5 ===== diff --git a/src/Adapter/AbstractStoryblokAdapter.php b/src/Adapter/AbstractStoryblokAdapter.php index c20d5ec..e7fcdc7 100644 --- a/src/Adapter/AbstractStoryblokAdapter.php +++ b/src/Adapter/AbstractStoryblokAdapter.php @@ -6,6 +6,7 @@ use Psr\Log\LoggerInterface; use Symfony\Component\RateLimiter\RateLimiterFactoryInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; +use Symfony\Contracts\Service\ResetInterface; use Symfony\Contracts\Service\ServiceSubscriberInterface; use Torr\Storyblok\Api\ContentApi; use Torr\Storyblok\Api\ManagementApi; @@ -15,7 +16,7 @@ use Torr\Storyblok\Story\StoryFactory; use Torr\Storyblok\Webhook\Request\RequestValidator; -abstract class AbstractStoryblokAdapter implements ServiceSubscriberInterface +abstract class AbstractStoryblokAdapter implements ServiceSubscriberInterface, ResetInterface { public readonly ContentApi $contentApi; public readonly ManagementApi $managementApi; @@ -96,4 +97,15 @@ abstract public function getDisplayName () : string; * Renames a technical name for this adapter. Must be a valid "snail". */ abstract public static function getKey () : string; + + /** + * + */ + #[\Override] + public function reset () : void + { + // pass reset calls to nested services + $this->contentApi->reset(); + $this->idSlugMapper->reset(); + } }