-
Notifications
You must be signed in to change notification settings - Fork 462
Closed
Milestone
Description
- Lunar version: 1.0.3
- Laravel Version: 12.32.5
- PHP Version: 8.4.14
- Database Driver & Version: MariaDB 10.6.23
Expected Behaviour:
When importing products and using database transactions, I would like the PriceObserver events not to be handled before the transaction is commited.
Actual Behaviour:
The SyncPriceCurrencies job fails because is it processed too early by the queue worker:
Illuminate\Database\Eloquent\ModelNotFoundException: No query results for model [App\Models\Price]. in /vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:780
Laravel provides a ShouldHandleEventsAfterCommit interface to implement by the observer to prevent this behaviour.
Steps To Reproduce:
Create products in a transaction. On Product::create() but before the transaction's commit, the job is dispatched.
Thank you!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done