getsentry/sentry-symfony

`LoginListener` triggers deprecation

Jean85 opened this issue · 2 comments

Jean85 commented

How do you use Sentry?

Sentry SaaS (sentry.io)

SDK version

sentry/sentry 3.21.0 sentry/sentry-symfony 4.10.0

Steps to reproduce

  • Run some tests under Symfony 5.4
  • LoginListener::isTokenAuthenticated calls \Symfony\Component\Security\Core\Authentication\Token\TokenInterface::isAuthenticated which is deprecated since Symfony 5.4

Expected result

No deprecation

Actual result

The following deprecation message:

Since symfony/security-core 5.4: Method "Symfony\Component\Security\Core\Authentication\Token\AbstractToken::isAuthenticated()" is deprecated, return null from "getUser()" instead when a token is
not authenticated.

Jean85 commented

This is the related Symfony PR: symfony/symfony#42650

The hardest part in fixing this would be detecting when to apply the different behavior, since there's no new (or missing) method to detect it.

[EDIT] This issue is caused by #720 and was reported as an indirect deprecation, I don't know why: https://github.com/getsentry/sentry-symfony/actions/runs/5715905670/job/15486243624?pr=720#step:7:66

Jean85 commented

Woha, fix was really easy, and starting right at me: #755

This hot weather is affecting me 😓