~singpolyma/dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] notify chatwoot on port-in req

Details
Message ID
<20241105211245.122578-1-phdavis1027@gmail.com>
DKIM signature
pass
Download raw message
Patch: +10 -5
---
 sgx_jmp.rb | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/sgx_jmp.rb b/sgx_jmp.rb
index cd2bb12..b0aa2ff 100644
--- a/sgx_jmp.rb
+++ b/sgx_jmp.rb
@@ -847,16 +847,21 @@ Command.new(
			reply.command << FormTemplate.render("lnp")
		end
	]).then { |(customer, iq)|
		PortInOrder.parse(customer, iq.form).complete_with do |form|
		order = PortInOrder.parse(customer, iq.form).complete_with { |form|
			Command.reply { |reply|
				reply.allowed_actions = [:next]
				reply.command << form
			}.then(&:form)
		end
	}.then do |order|
		}

		[order, customer]
	}.then do |(order, customer)|
		order_id = BandwidthIris::PortIn.create(order.to_h)[:order_id]
		BLATHER.join(CONFIG[:notify_admin], "sgx-jmp")
		BLATHER.say(CONFIG[:notify_admin], order.message(order_id), :groupchat)
		customer.stanza_from(Blather::Stanza::Message.new(
			Blather::JID.new(""),
			order.message(order_id)
		))

		Command.finish(
			"Your port-in request has been accepted, " \
			"support will contact you with next steps"
-- 
2.34.1
Details
Message ID
<Zyz7Dd8nq9M2+AKV@singpolyma-beefy.lan>
In-Reply-To
<20241105211245.122578-1-phdavis1027@gmail.com> (view parent)
DKIM signature
pass
Download raw message
>---
> sgx_jmp.rb | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
>diff --git a/sgx_jmp.rb b/sgx_jmp.rb
>index cd2bb12..b0aa2ff 100644
>--- a/sgx_jmp.rb
>+++ b/sgx_jmp.rb
>@@ -847,16 +847,21 @@ Command.new(
> 			reply.command << FormTemplate.render("lnp")
> 		end
> 	]).then { |(customer, iq)|
>-		PortInOrder.parse(customer, iq.form).complete_with do |form|
>+		order = PortInOrder.parse(customer, iq.form).complete_with { |form|
> 			Command.reply { |reply|
> 				reply.allowed_actions = [:next]
> 				reply.command << form
> 			}.then(&:form)
>-		end
>-	}.then do |order|
>+		}
>+
>+		[order, customer]

Did you try this? It looks like you're putting a promise into a variable 
then returning that promise as part of an array. I don't think that will do 
what you need it to.  It would if you did:

	 Promise.all([order, customer])

though in this case I probably would do:

	...complete_with { |form|
		# ...
	}.then { |order| [order, customer] }

>+	}.then do |(order, customer)|
> 		order_id = BandwidthIris::PortIn.create(order.to_h)[:order_id]
>-		BLATHER.join(CONFIG[:notify_admin], "sgx-jmp")
>-		BLATHER.say(CONFIG[:notify_admin], order.message(order_id), :groupchat)
>+		customer.stanza_from(Blather::Stanza::Message.new(
>+			Blather::JID.new(""),
>+			order.message(order_id)
>+		))
>+
> 		Command.finish(
> 			"Your port-in request has been accepted, " \
> 			"support will contact you with next steps"
>-- 
>2.34.1
>
Reply to thread Export thread (mbox)