Import some hotfixes from prod

Stephen Paul Weber created

Change summary

lib/registration.rb | 3 ++-
sgx_jmp.rb          | 2 +-
web.rb              | 6 +++---
3 files changed, 6 insertions(+), 5 deletions(-)

Detailed changes

lib/registration.rb 🔗

@@ -5,10 +5,11 @@ require "ruby-bandwidth-iris"
 require "securerandom"
 
 require_relative "./alt_top_up_form"
-require_relative "./command"
 require_relative "./bandwidth_tn_order"
+require_relative "./command"
 require_relative "./em"
 require_relative "./oob"
+require_relative "./proxied_jid"
 require_relative "./tel_selections"
 
 class Registration

sgx_jmp.rb 🔗

@@ -431,7 +431,7 @@ Command.new(
 	list_for: ->(*) { true },
 	customer_repo: CustomerRepo.new(sgx_repo: Bwmsgsv2Repo.new)
 ) {
-	Command.customer.catch {
+	Command.customer.catch_only(CustomerRepo::NotFound) {
 		Sentry.add_breadcrumb(Sentry::Breadcrumb.new(message: "Customer.create"))
 		Command.execution.customer_repo.create(Command.execution.iq.from.stripped)
 	}.then { |customer|

web.rb 🔗

@@ -82,7 +82,7 @@ class Web < Roda
 
 	def log_error(e)
 		log.error(
-			"Error raised during #{request.full_path}: #{e.class}",
+			"Error raised during #{request.fullpath}: #{e.class}",
 			e,
 			loggable_params
 		)
@@ -269,13 +269,13 @@ class Web < Roda
 				end
 
 				r.post do
+					Sentry.set_user(tel: params["to"])
 					customer_repo(
 						sgx_repo: Bwmsgsv2Repo.new
 					).find_by_tel(params["to"]).then { |customer|
 						Sentry.set_user(id: customer.customer_id)
 						EMPromise.all([
-							customer.customer_id,
-							customer.fwd,
+							customer.customer_id, customer.fwd,
 							call_attempt_repo.find_inbound(
 								customer, params["from"], call_id: params["callId"]
 							)