diff --git a/CHANGELOG.md b/CHANGELOG.md index 828fe39..a965f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- The `API` service is now an isolated `OpenFeatureAPI` instance created by the container (SDK 2.3.0 isolated instances) instead of the `OpenFeatureAPI::getInstance()` global singleton. Provider, hooks, and evaluation context are no longer shared with other kernels running in the same PHP process. +- `open-feature/sdk` requirement raised from `^2.2` to `^2.3` (the bundle relies on the public `OpenFeatureAPI` constructor introduced in SDK 2.3.0). + +### Upgrade notes + +- Run `composer update open-feature/sdk` if your lock file pins a version below 2.3.0. +- Code calling `OpenFeatureAPI::getInstance()` directly now gets an instance distinct from the bundle's `API` service (different provider, hooks, and evaluation context). Inject the `API` or `Client` service instead. + ## [0.3.0] - 2026-06-15 ### Added diff --git a/composer.json b/composer.json index 0924ab6..07a9755 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }, "require": { "php": ">=8.2", - "open-feature/sdk": "^2.2", + "open-feature/sdk": "^2.3", "symfony/config": "^6.4|^7.4|^8.0", "symfony/dependency-injection": "^6.4|^7.4|^8.0", "symfony/http-kernel": "^6.4|^7.4|^8.0" diff --git a/src/Resources/config/services.php b/src/Resources/config/services.php index 7303072..a06f9d5 100644 --- a/src/Resources/config/services.php +++ b/src/Resources/config/services.php @@ -20,8 +20,8 @@ return static function (ContainerConfigurator $container): void { $services = $container->services(); - $services->set(API::class, OpenFeatureAPI::class) - ->factory([OpenFeatureAPI::class, 'getInstance']); + // Isolated instance (SDK >= 2.3): no state shared with the global singleton or other kernels + $services->set(API::class, OpenFeatureAPI::class); $services->set(Client::class) ->factory([service(API::class), 'getClient'])