You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raiseException("Got response from sending SMS with no location header")
# Nominally we should parse the URL, but we can just split on '/' since
# we only care about the last part.
parts=headers["Location"][0].split("/")
iflen(parts) <2:
raiseException(
"Got response from sending SMS with malformed location header"
)
It looks like we do send the request but we're not actually checking if it succeeded (by checking the status code in the response). According to https://www.openmarket.com/docs/Content/apis/v4http/send-json.htm we should be checking whether the status code in the response is 202 Accepted.
It looks like we check the presence of a Location header though, which according to the doc is only present in a 202 response, but maybe that's not enough?
For extra context, I was trying to figure out why I didn't receive a text message when adding a phone number to my matrix.org account despite Sydent looking like it succeeded:
Oct 5 10:14:15 corus sydent-vectoris[16661]: 2021-10-05 10:14:15,659 - sydent.validators.msisdnvalidator - 126 - INFO - Attempting to text code [...] to 44[my phone number] (country 44) with originator {'type': 'alpha', 'text': 'Element'}
Oct 5 10:14:15 corus sydent-vectoris[16661]: 2021-10-05 10:14:15,659 - twisted - 147 - INFO - "::ffff:10.101.0.14" - - [05/Oct/2021:10:14:14 +0000] "POST /_matrix/identity/api/v1/validate/msisdn/requestToken HTTP/1.1" 200 94 "-" "Synapse/1.44.0rc2 (b=matrix-org-hotfixes,ebbd37b66)"
The text was updated successfully, but these errors were encountered:
In
sendTextSMS
:sydent/sydent/sms/openmarket.py
Lines 63 to 110 in bf83fe1
It looks like we do send the request but we're not actually checking if it succeeded (by checking the status code in the response). According to https://www.openmarket.com/docs/Content/apis/v4http/send-json.htm we should be checking whether the status code in the response is
202 Accepted
.It looks like we check the presence of a
Location
header though, which according to the doc is only present in a 202 response, but maybe that's not enough?For extra context, I was trying to figure out why I didn't receive a text message when adding a phone number to my matrix.org account despite Sydent looking like it succeeded:
The text was updated successfully, but these errors were encountered: