Batchable
doesn't work properly without InteractsWithQueue
trait
#50057
Labels
Batchable
doesn't work properly without InteractsWithQueue
trait
#50057
Laravel Version
10.43.0
PHP Version
8.2.10
Database Driver & Version
No response
Description
As far as I know it is possible to have working jobs without using the
InteractsWithQueue
trait but when using the job batching functionality usingBus::batch
andBatchable
trait this is required for the batch to work properly.When the
InteractsWithQueue
trait is not present on the job class the batch will never be considered as finished. I believe this is due to the if statement in theensureSuccessfulBatchJobIsRecorded
method onCallQueuedHandler
class which returns early if either the job class does not use theBatchable
trait or theInteractsWithQueue
trait. I'm not quite sure why this is.I think one of these solutions should be implemented:
InteractsWithQueue
trait in theBatchable
trait itself so it is guaranteed that it will work.ensureSuccessfulBatchJobIsRecorded
is somehow not needed it can be removed and then it should work. I am not too sure about this because I couldn't find any uses of the methods available on the InteractsWithQueue trait used inBatchable
trait or theIlluminate\Bus\Batch
class but I might not have looked in the right places.I am interesed in contributing to this issue but not quite sure which of these solutions or any other solution is prefered by the maintainers.
Steps To Reproduce
The text was updated successfully, but these errors were encountered: