Description
Symfony version(s) affected
5.1.8 and up
Description
When using the DoctrineTransport with PostgreSQL, the queue table is created with a trigger to enable LISTEN/NOTIFY feature.
This is done by checking if the driver is an instance of AbstractPostgreSQLDriver
.
This check won't work though, if the driver is decorated. This then leads to missing trigger to use the LISTEN/NOTIFY feature.
How to reproduce
I experienced this when when having sentry/sentry-symfony
installed.
My sentry.yaml
looks like this:
sentry:
dsn: "%env(SENTRY_DSN)%"
register_error_listener: false
options:
environment: "%env(SENTRY_ENV)%"
# release: "%env(VERSION)%" #your app version
monolog:
handlers:
sentry:
type: sentry
level: !php/const Monolog\Logger::ERROR
hub_id: Sentry\State\HubInterface
Possible Solution
Currently the check is done by checking the instance of the driver in the DoctrineTransportFactory.
Instead of checking the Driver itself, we might get the platform and check if the platform is of type PostgreSQLPlatform
like so:
if ($useNotify && $driverConnection->getDriver()->getDatabasePlatform() instanceof PostgreSQLPlatform) {
Is this a viable solution or do I miss something here?
Additional Context
No response