Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DoctrineSubscriber throw deprecation when Driver is wrapped with another class #184

Closed
oleg-andreyev opened this issue Oct 30, 2023 · 11 comments · Fixed by #195
Closed

DoctrineSubscriber throw deprecation when Driver is wrapped with another class #184

oleg-andreyev opened this issue Oct 30, 2023 · 11 comments · Fixed by #195
Labels
bug Something isn't working feedback needed Further information is requested

Comments

@oleg-andreyev
Copy link
Contributor

Q A
auditor version 2.4.7
PHP version 8.1
Database MySQL

Summary

I have both Auditor and Sentry packages.
Sentry also has a middleware that wraps connection with a special class.
Depending on priority of this middlewares DoctrineSubscriber may trigger a deprecation because $driver is not a DHDriver, but actually it's wrapped.

Current behavior

trigger deprecation when it's actually should not

How to reproduce

Install both damienharper/auditor-bundle and sentry/sentry-symfony

Expected behavior

correct detection of DHDriver

@oleg-andreyev oleg-andreyev added the bug Something isn't working label Oct 30, 2023
@oleg-andreyev
Copy link
Contributor Author

oleg-andreyev commented Oct 31, 2023

related also to #185

@DamienHarper
Copy link
Owner

@oleg-andreyev is this issue still relevant?

@DamienHarper DamienHarper added the feedback needed Further information is requested label Dec 19, 2023
@oleg-andreyev
Copy link
Contributor Author

@DamienHarper Relevant for 2.x

@DamienHarper
Copy link
Owner

@oleg-andreyev could you please share a way (code sample) so I can reproduce the issue?

@oleg-andreyev
Copy link
Contributor Author

oleg-andreyev commented Dec 21, 2023

image

image

you'll need

# composer.json

"sentry/sentry-symfony": "^4.6",
"damienharper/auditor-bundle": "^5.0",
# sentry.yaml
sentry:
    dsn: '%env(SENTRY_DSN)%'
    options:
        traces_sample_rate: 0.25
        # Set a sampling rate for profiling - this is relative to traces_sample_rate
        profiles_sample_rate: 1.0
        before_send: 'sentry.callback.before_send'
    register_error_listener: false # Disables the ErrorListener to avoid duplicated log in sentry

monolog:
    handlers:
        sentry:
            type: sentry
            level: !php/const Monolog\Logger::ERROR
            hub_id: Sentry\State\HubInterface

basically any wrapper will break it because current assumption that DHDriver is the last one.

@DamienHarper
Copy link
Owner

@oleg-andreyev thanks

@craigh
Copy link

craigh commented Feb 13, 2024

@DamienHarper any progress here? We are experiencing this problem in our project also (Sym6.4+sentry/[email protected])

@oleg-andreyev were you able to resolve somehow?

@oleg-andreyev
Copy link
Contributor Author

@craigh planning to work on solution

@oleg-andreyev
Copy link
Contributor Author

@craigh @DamienHarper added my PR #195

@DamienHarper
Copy link
Owner

Thanks @oleg-andreyev for the PR, much appreciated. It's currently merged into 2.x.
I'll release it soon.

@oleg-andreyev
Copy link
Contributor Author

Closed as merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feedback needed Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants