Implement 428 response with a captcha
Signal implemented forms of rate limiting on the push service (Signal-Android 31e1c6f7aa, Signal Server commit?), and may return 428 errors.
This has been discovered by someone with a new account on the forum.
[2022-05-27T11:57:17Z DEBUG libsignal_service_actix::push_service] HTTP request PUT https://chat.signal.org/v1/messages/da3c83ad-8c45-4d14-87d5-xxxxxxxxxxxx
[2022-05-27T11:57:18Z DEBUG libsignal_service_actix::push_service] AwcPushService::put response:
ClientResponse HTTP/1.1 428 Precondition Required
headers:
"connection": "keep-alive"
"date": "Fri, 27 May 2022 11:57:18 GMT"
"content-type": "application/json"
"content-length": "88"
"retry-after": "86400"
"x-signal-timestamp": "1653652638324"
[2022-05-27T11:57:18Z TRACE libsignal_service_actix::push_service] Unhandled response with body: Ok(b"{\"token\":\"6090bb08-659a-47ea-824e-xxxxxxxxxxxx\",\"options\":[\"recaptcha\",\"pushChallenge\"]}")
[2022-05-27T11:57:18Z ERROR harbour_whisperfish::worker::client] Sending message: Error sending message: Unexpected response: HTTP 428
Suggested workaround in #417 (closed), but the "correct" fix is to implement a show-captcha-then-retry approach.
Edited by Ruben De Smet