From fc0d1c12bd74e9dbba39f23f6e32a6b1536238e9 Mon Sep 17 00:00:00 2001 From: Isaac Adzah Sai Date: Sat, 20 Jan 2024 18:57:35 +0000 Subject: [PATCH] Timeout resumation is based on last session and not begining of session --- src/Ussd.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Ussd.php b/src/Ussd.php index 2741f53..f0af658 100644 --- a/src/Ussd.php +++ b/src/Ussd.php @@ -191,9 +191,13 @@ public function run(): mixed [$message, $terminating] = $this->bail($exception); } - if ($terminating && ContinuingMode::START !== $this->continuingMode) { + if (ContinuingMode::START !== $this->continuingMode) { /** @var Record */ $record = App::make(Record::class); - $record->forget(static::SPUR, true); + if ($terminating) { + $record->forget(static::SPUR, true); + } elseif ($spur = $record->get(static::SPUR, public: true)) { + $record->set(static::SPUR, $spur, $this->continuingTtl, true); + } } return $this->response instanceof Response