Ilhasoft / RCApps.RapidPro-Channel

0 stars 1 forks source link

Failing to make requests to RP instance #8

Closed rowanseymour closed 3 years ago

rowanseymour commented 3 years ago

Need a little help debugging this. I can see in the RC logs that it's trying to make a request to courier, and I can take the request details, make the request manually, and it works fine (message is created in RP). But nothing happens otherwise, and it doesn't seem from the courier logs that the request is made. Is the app missing some permission perhaps?

I20201102-22:38:03.140(0) The App 0c5168d3-65bc-4418-9714-2de29ae54d9b is searching for records that are associated with the following: [   RocketChatAssociationRecord {     model: 'misc',     id: 'AppPersistence_callback_url_textit_staging'   } ] 
I20201102-22:38:03.143(0) The App 0c5168d3-65bc-4418-9714-2de29ae54d9b is requesting from the outter webs: {   appId: '0c5168d3-65bc-4418-9714-2de29ae54d9b',   method: 'post',   url: 'http://textit.staging.nyaruka.com/c/rc/e1dde606-9875-41da-af8d-f431dd22cde2/receive',   request: {     headers: {       'Content-Type': 'application/json',       Authorization: 'Token XXXXXXXXXXX'     },     data: { user: [Object], text: 'ok great' },     params: {},     content: '{"user":{"urn":"direct:rowanseymour","username":"rowanseymour","full_name":"Rowan"},"text":"ok great"}',     npmRequestOptions: {}   } } 
rowanseymour commented 3 years ago

I think maybe RC wasn't making the request because the URL wasn't https. I tweaked the RP side so that the generated courier URL uses the usual logic we use for other channel types, and now the created URL is https, and it seems to be working fine.