From 12e2eef3146370c780b4d6c9ebf4bcf7c959ddfe Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 14 Feb 2022 20:49:00 -0500 Subject: [PATCH] Add customer_id to Sentry where relevant --- web.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web.rb b/web.rb index 947ec65f4d0c904bfe4a69093c907f2d0eb07553..9646e061dcb3932914b3b09dfea88db05d65e251 100644 --- a/web.rb +++ b/web.rb @@ -165,6 +165,7 @@ class Web < Roda end customer_repo.find_by_tel(params["to"]).then do |customer| + Sentry.set_user(id: customer.customer_id) CDR.for_inbound(customer.customer_id, params).save end end @@ -200,6 +201,7 @@ class Web < Roda ) customer_repo.find_by_tel(params["to"]).then do |customer| + Sentry.set_user(id: customer.customer_id) m = Blather::Stanza::Message.new m.chat_state = nil m.from = from_jid @@ -218,6 +220,7 @@ class Web < Roda next "OK<5" unless duration > 5 customer_repo.find_by_tel(params["to"]).then do |customer| + Sentry.set_user(id: customer.customer_id) m = Blather::Stanza::Message.new m.chat_state = nil m.from = from_jid @@ -235,6 +238,7 @@ class Web < Roda customer_repo(sgx_repo: Bwmsgsv2Repo.new) .find_by_tel(params["to"]) .then { |c| + Sentry.set_user(id: c.customer_id) EMPromise.all([c, c.ogm(params["from"])]) }.then do |(customer, ogm)| render :voicemail, locals: { @@ -249,6 +253,7 @@ class Web < Roda customer_repo( sgx_repo: Bwmsgsv2Repo.new ).find(params.fetch("customer_id")).then do |customer| + Sentry.set_user(id: customer.customer_id) call_attempt_repo.find_inbound( customer, params["from"], @@ -263,12 +268,12 @@ class Web < Roda 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, call_attempt_repo.find_inbound( - customer, params["from"], - call_id: params["callId"] + customer, params["from"], call_id: params["callId"] ) ]) }.then do |(customer_id, fwd, ca)| @@ -305,6 +310,7 @@ class Web < Roda customer_repo( sgx_repo: Bwmsgsv2Repo.new ).find_by_format(from).then do |c| + Sentry.set_user(id: c.customer_id) call_attempt_repo.find_outbound( c, params["to"],