[11.x] Fix attribute inheritance for nested scheduled groups#53626
Merged
taylorotwell merged 2 commits intolaravel:11.xfrom Nov 21, 2024
istiak-tridip:fix-schedule_group
Merged
[11.x] Fix attribute inheritance for nested scheduled groups#53626taylorotwell merged 2 commits intolaravel:11.xfrom istiak-tridip:fix-schedule_group
taylorotwell merged 2 commits intolaravel:11.xfrom
istiak-tridip:fix-schedule_group
Conversation
|
I have no idea where you find the things in the framework that need fixing but you seem to be pushing out some ace work recently. 🔥 |
Member
|
Hey @istiak-tridip ... For the first situation, I would catch the fatal exception and throw an informative error message. For the second situation, I think the expression would reset to hourly so that you could in theory group a bunch of tasks but opt out to some custom customization for a scheduled task when you need to. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves a bug in which the attributes of the parent schedule group were not applied to the nested group's events. @rcerljenko reported the issue in #53608.
Example of unexpected behavior:
P.S.
While debugging, I encountered two behaviors that I’m unsure how to handle, and I’d appreciate feedback.
Behavior One
Both examples below throw fatal exceptions because no
PendingEventAttributeis set before creating a group.What should be done, as I think groups should not be created without common attributes?
groupmethod to thePendingEventAttributeclass to prevent callingSchedule::groupdirectlyBehavior Two
The frequency of the second event becomes this:
The
hourly()method with the group'sdaily()results in a cron expression like0 0 * * *, whereas the expected expression is0 * * * *.Again what should be done when modifying group events?
* * * * *so that thehourly()generates correct frequency@stevebauman @rodrigopedra @taylorotwell Tagging you for your valuable input during the initial PR and hoping to get your feedback on this one as well.