~singpolyma/sgx-jmp

94f5a8d2effd718f4374dcc9ea55b0c7371a9a56 — Stephen Paul Weber 3 years ago be92f94
Use before filter to actually come before everything

Otherwise we go in hierarchy order and stanza comes last.
1 files changed, 3 insertions(+), 3 deletions(-)

M sgx_jmp.rb
M sgx_jmp.rb => sgx_jmp.rb +3 -3
@@ 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|