diff --git a/sgx_jmp.rb b/sgx_jmp.rb index 5c70c2b4118955f627316903da92efdcffdc9a50..3a2e32399dc0e8bb90f625a6eec695e690bc85ff 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|