From 94f5a8d2effd718f4374dcc9ea55b0c7371a9a56 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 23 Jun 2021 15:22:48 -0500 Subject: [PATCH] Use before filter to actually come before everything Otherwise we go in hierarchy order and stanza comes last. --- sgx_jmp.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 5c70c2b..3a2e323 100644 --- a/sgx_jmp.rb +++ b/sgx_jmp.rb @@ -19,7 +19,6 @@ CONFIG = .new(safe: Dhall::Coder::JSON_LIKE + [Symbol, Proc]) .load(ARGV[0], transform_keys: ->(k) { k&.to_sym }) -Blather::Stanza.handler_list << :stanza singleton_class.class_eval do include Blather::DSL Blather::DSL.append_features(self) @@ -140,10 +139,10 @@ message to: /\Aaccount@/ do |m| end end -stanza to: /\Acustomer_/, from: /@#{CONFIG[:sgx]}(\/|\Z)/ do |s| +before nil, to: /\Acustomer_/, from: /(\A|@)#{CONFIG[:sgx]}(\/|\Z)/ do |s| sentry_hub = new_sentry_hub(s, name: "stanza_customer") Customer.for_customer_id( - m.to.node.delete_prefix("customer_") + s.to.node.delete_prefix("customer_") ).then { |customer| sentry_hub.current_scope.set_user( id: customer.customer_id, @@ -151,6 +150,7 @@ stanza to: /\Acustomer_/, from: /@#{CONFIG[:sgx]}(\/|\Z)/ do |s| ) customer.stanza_to(s) }.catch { |e| panic(e, sentry_hub) } + halt end message do |m| -- 2.38.5