Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
5.2.6
=====

* (bug) Fix missing reset of `ContentApi` and `StoryblokIdSlugMapper`.


5.2.5
=====

Expand Down
14 changes: 13 additions & 1 deletion src/Adapter/AbstractStoryblokAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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();
}
}
Loading