Skip to content

Conversation

@adrianrudnik
Copy link
Contributor

@adrianrudnik adrianrudnik commented Apr 22, 2025

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

The way the schedule providers work, either by tagging a service or using the AsSchedule attribute, can lead to a scenario where multiple ScheduleProviders register for the same schedule name (e.g. default).

The problem arises when the CompilerPass simply overwrites the previously registered one without throwing a warning, a notice or anything else. The problem would be that a full ScheduleProvider would simply not register and therefore not run.

I decided to use the InvalidArgumentException from DI, as I could not get a trigger_error on E_USER_WARNING to show anything in a dev environment, in case I miss a scenario where this would actually be a desirable use case.

Not sure if the test is complete enough for this scenario. I tried to base it on others found in HttpKernel.

Also not sure if this falls under "feature" or "bug fix", so I marked it as a feature above.

@adrianrudnik
Copy link
Contributor Author

A similar Q&A discussion from last year can be found here

Copy link
Member

@kbond kbond left a comment

Choose a reason for hiding this comment

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

Nice, this makes sense. I agree, let's call this a feature. Can you add an entry to the scheduler's CHANGELOG?

@adrianrudnik
Copy link
Contributor Author

@kbond Sure! Hope the message within the changelog is OK and detailed enough.

@fabpot fabpot modified the milestones: 7.3, 7.4 May 26, 2025
@nicolas-grekas
Copy link
Member

Thank you @adrianrudnik.

@nicolas-grekas nicolas-grekas merged commit f8e605c into symfony:7.4 May 30, 2025
11 checks passed
This was referenced Oct 27, 2025
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.

5 participants