Wait for call attempt to start before returning

Stephen Paul Weber created

This should prevent calls from ending before they start... I hope

Change summary

web.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Detailed changes

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"