From 9fbd964f675d978d5f2206fc616573c56471b03d Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Tue, 9 Jul 2024 16:10:27 -0500 Subject: [PATCH] Wait for call attempt to start before returning This should prevent calls from ending before they start... I hope --- web.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web.rb b/web.rb index 2a0431c091fbca8a0f576d90e0a19d95894374a6..69b5564ae7032178229d6d464cc38be357d8ba61 100644 --- a/web.rb +++ b/web.rb @@ -455,8 +455,9 @@ class Web < Roda ).then do |ca| r.json { ca.to_json } - call_attempt_repo.starting_call(c, params["callId"]) - render(*ca.to_render) + call_attempt_repo.starting_call(c, params["callId"]).then do + render(*ca.to_render) + end end }.catch_only(CustomerRepo::NotFound) { render "outbound/no_customer"