Skip to content

Commit 3bc31f4

Browse files
committed
fix: explicitly stage/clear transaction to correctly run afterCommit jobs
[laravel v10.32.0](laravel/framework#48859) requires explicit staging of transactions
1 parent b57fa3d commit 3bc31f4

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Changed
1212
- [Breaking] SessionNotFoundErrorMode was removed and will always run clear session pool. (#132) (#130)
1313
- [Breaking] Auth cache and Session pool now share the same file cache adapter (#139)
1414

15+
Fixed
16+
- Explicitly stage/clear transaction on commit to correctly run afterCommit jobs in Laravel >= [v10.32.0](https://github.com/laravel/framework/pull/48859) (#144)
17+
1518
# v5.2.2 (2023-08-22)
1619

1720
Fixed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"php": "^8.1",
1212
"ext-grpc": "*",
1313
"ext-json": "*",
14-
"laravel/framework": "~10.0",
14+
"laravel/framework": "^10.32.0",
1515
"google/cloud-spanner": "^1.58.4",
1616
"grpc/grpc": "^1.42",
1717
"symfony/cache": "~6",

src/Concerns/ManagesTransactions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ protected function performSpannerCommit(): void
141141
$this->currentTransaction->commit();
142142
}
143143

144+
$this->transactionsManager?->stageTransactions($this->getName());
145+
144146
$this->transactions = max(0, $this->transactions - 1);
145147
if ($this->isTransactionFinished()) {
146148
$this->currentTransaction = null;

0 commit comments

Comments
 (0)