Update: 2026-07-10 03:04:06

This commit is contained in:
Hamza-Ayed
2026-07-10 03:04:06 +03:00
parent 2ff7450d0b
commit b18fd027b6
22 changed files with 2661 additions and 96 deletions
@@ -313,6 +313,17 @@ try {
// ✅ Payment succeeded — COMMIT
$con->commit();
// 🆕 Cache ride state in Redis — placed immediately after commit(), before
// the best-effort remote-DB sync / streak / notification code below, so a
// later exception in any of those non-critical steps can never suppress
// this write for a ride that's genuinely finished in MySQL.
sendToLocationServer('update_ride_state', [
'ride_id' => $rideId,
'status' => $newStatus,
'driver_id' => $driver_id,
'passenger_id' => $passengerId,
]);
// 🔥 [Fix Split-Brain] تحديث القاعدة البعيدة الآن فقط، بعد أن أصبح الدفع
// والتحديث المحلي مؤكدَين نجاحهما — يبقي الحالتين متطابقتين دائماً.
// فشل هذا التحديث best-effort فقط (لا يُرجع الرحلة المحلية المُنجَزة فعلاً).