SyliusRefundPlugin version affected: 1.6.1
Description
SyliusRefundPlugin::build() unconditionally registers Sylius\Telemetry\TelemetryCompilerPass (from the sylius/telemetry package, v1.0.1):
public function build(ContainerBuilder $container): void
{
parent::build($container);
$container->addCompilerPass(new TelemetryCompilerPass());
}
That compiler pass loads every sylius.telemetry.* service (the kernel.terminate listener,
all data providers, the HTTP sender, etc.) without ever checking the SYLIUS_TELEMETRY_ENABLED
env var
Steps to reproduce
On a Sylius application with sylius/refund-plugin installed:
- Run with telemetry explicitly enabled; the services are listed, as expected:
SYLIUS_TELEMETRY_ENABLED=1 APP_ENV=prod php bin/console debug:container sylius.telemetry.listener --env=prod --no-debug
- Run again with telemetry explicitly disabled; the same services are still listed,
which is the bug:
SYLIUS_TELEMETRY_ENABLED=0 APP_ENV=prod php bin/console debug:container sylius.telemetry.listener --env=prod --no-debug
- To confirm
TelemetryCompilerPass registration is the exact cause, comment out the single
line in vendor/sylius/refund-plugin/src/SyliusRefundPlugin.php:
final class SyliusRefundPlugin extends Bundle
{
use SyliusPluginTrait;
public function build(ContainerBuilder $container): void
{
parent::build($container);
// $container->addCompilerPass(new TelemetryCompilerPass());
}
}
- Re-run the same command as step 2:
SYLIUS_TELEMETRY_ENABLED=0 APP_ENV=prod php bin/console debug:container sylius.telemetry.listener --env=prod --no-debug
The telemetry services are now correctly absent:
No services found that match "sylius.telemetry.listener".
Thank you for your help
SyliusRefundPlugin version affected: 1.6.1
Description
SyliusRefundPlugin::build()unconditionally registersSylius\Telemetry\TelemetryCompilerPass(from thesylius/telemetrypackage, v1.0.1):That compiler pass loads every
sylius.telemetry.*service (thekernel.terminatelistener,all data providers, the HTTP sender, etc.) without ever checking the
SYLIUS_TELEMETRY_ENABLEDenv var
Steps to reproduce
On a Sylius application with
sylius/refund-plugininstalled:which is the bug:
TelemetryCompilerPassregistration is the exact cause, comment out the singleline in
vendor/sylius/refund-plugin/src/SyliusRefundPlugin.php:The telemetry services are now correctly absent:
No services found that match "sylius.telemetry.listener".Thank you for your help