-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Bus::chain
Skipping jobs with readonly non-scalar properties
#51877
Comments
Bus::chain
Bus::chain
Skipping jobs with readonly non-scalar properties
Thanks @shaffe-fr. It's not by consequence that this is related to the enum usages in your PR? |
Hi @driesvints, indeed, I had the same issue with classes. |
Thank you for reporting this issue! As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team. Thank you! |
I believe this issue is due to the package(laravel/serializable-closure) not supporting the readonly property. |
The issue I have with chained batches is that they stop executing whenever I have a job that uses a class type for its properties. I've tried many combinations of visibility, readonly, promoted properties, non-promoted properties, serialising and unserialising the classes myself All the jobs/batches in the chain are correctly displayed in the payload in both the Redis and database drivers. |
@juse-less Could you provide some example codes? I can't reproduce it. |
@rust17 Hmm. I'll try your fix today, just to be sure I'm not missing something. |
I tried your fix with the code in the PR #51878 but it does not seems to work. |
@shaffe-fr Hmm. This looks strange. I tried it and it works for me. You can see the results here. Could you consider accepting this PR? Try to trigger the GitHub Action and check if there are the same errors. |
I tried a quick and dirty test: I added the if statement in the Native.php file modification in the vendor. I'll try it directly in my project using your version of laravel/serializable-closure. |
I confirm that I don't have the problem in my project with this fix! |
Same here. Seems like it actually fixes the problem. I tested on the state I left things in a couple weeks ago, but definitely works now. I'm gonna reset all my changes I did while debugging, but I'm confident this does solve it altogether. |
Hey @driesvints, looks like we have a winner here :) |
Laravel Version
10.x and 11.x
PHP Version
8.1, 8.2 and 8.3
Database Driver & Version
No response
Description
Description of the Issue
When a
Bus::chain
contains a job with a readonly promoted non-scalar property, only the first job or batch in the chain is executed. The subsequent jobs or batches appear to be discarded. Additionally, even if the chain is dispatched on a non-default queue, the jobs still run on the default queue.No exceptions were found in the logs.
Environment
Laravel versions: 10.x and 11.x
PHP versions: 8.1, 8.2, and 8.3
Evidence
Failing test PR : #51878
A repository that reproduces the problem can be found here: shaffe-fr@f1b3cad
Here is a screenshot illustrating the issue:
Steps To Reproduce
Bus::chain
with at least one job having a readonly promoted non-scalar property.The text was updated successfully, but these errors were encountered: