Skip to content

[Messenger] Allow any ServiceResetterInterface implementation in ResetServicesListener #60999

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

Open
wants to merge 1 commit into
base: 7.4
Choose a base branch
from

Conversation

santysisi
Copy link
Contributor

@santysisi santysisi commented Jul 1, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues no
License MIT

Summary

This PR updates the ResetServicesListener to depend on the ServicesResetterInterface instead of the concrete ServicesResetter class.

@santysisi santysisi requested a review from welcoMattic as a code owner July 1, 2025 00:19
@carsonbot carsonbot added this to the 8.0 milestone Jul 1, 2025
@santysisi santysisi force-pushed the refactor/use-interface-in-reset-services-listener branch from c0f0ae3 to aa6fb3b Compare July 1, 2025 00:28
@santysisi
Copy link
Contributor Author

santysisi commented Jul 1, 2025

Hi 👋 I hope you're all doing well!

I think this kind of change is acceptable in a new major version (like now), but if I'm mistaken, I'm happy to update the PR.

@xabbuh
Copy link
Member

xabbuh commented Jul 1, 2025

The change itself looks reasonable to me, but that's a new feature and we should merge it into the 7.4 branch (to fix the failing tests on the 8.0 branch I opened #61003.

@xabbuh xabbuh modified the milestones: 8.0, 7.4 Jul 1, 2025
@xabbuh xabbuh removed the Bug label Jul 1, 2025
@santysisi santysisi force-pushed the refactor/use-interface-in-reset-services-listener branch 2 times, most recently from a240e9a to 83714d6 Compare July 1, 2025 12:34
@santysisi santysisi changed the base branch from 8.0 to 7.4 July 1, 2025 12:35
@santysisi
Copy link
Contributor Author

Hi 👋 I hope you're all doing well!
I've updated the PR with your suggestions, please let me know if there's anything else I should change. ❤️

8.0
---

* Use `ServicesResetterInterface` instead of concrete `ServicesResetter` in `ResetServicesListener`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Use `ServicesResetterInterface` instead of concrete `ServicesResetter` in `ResetServicesListener`
* Allow any `ServiceResetterInterface` implementation in `ResetServicesListener`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the PR header to your suggestion @xabbuh

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi 👋 I hope both of you are doing well ❤️
Thank you so much for the suggestion and the update to the PR header, i really appreciate it! ❤️

@OskarStark OskarStark changed the title [Messenger] use ServicesResetterInterface instead of concrete ServicesResetter in ResetServicesListener [Messenger] Allow any ServiceResetterInterface implementation in ResetServicesListener Jul 1, 2025
@santysisi santysisi force-pushed the refactor/use-interface-in-reset-services-listener branch from 83714d6 to 93fdc14 Compare July 1, 2025 22:03
@santysisi
Copy link
Contributor Author

santysisi commented Jul 1, 2025

Hey! 👋

The pipeline failure in the 8.2-low-deps job is due to the fact that the current minor version is 6.4, while the ServicesResetterInterface was introduced in 7.3.

I see a few options we could take here:

  1. Bump the minor version requirement to ^7.3 (this would solve the issue directly, but increases the minimum supported version).
  2. Use a conditional implementation like this, checking if the interface exists:
if (interface_exists(ServicesResetterInterface::class)) {
    // version using ServicesResetterInterface
} else {
    // fallback using ServicesResetter
}

This would keep compatibility with both versions and avoid raising the minimum requirement.
3. Close this PR and revisit the implementation once ^7.3 becomes the minimum supported version.

Let me know which path you'd prefer, or if there's another alternative I haven't considered. Happy to adjust the PR accordingly! 🙏❤️

Edit: some resources
https://github.com/symfony/symfony/blob/7.4/src/Symfony/Component/Messenger/composer.json#L29
https://github.com/symfony/symfony/blob/7.4/src/Symfony/Component/HttpKernel/CHANGELOG.md#73

@xabbuh
Copy link
Member

xabbuh commented Jul 2, 2025

bumping the require for the HttpKernel component makes sense to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants