fix an issue when onboarding gets stuck in 421 loop when trying to fetch UserProfile config

This commit is contained in:
Ryan ZHAO 2024-05-29 15:34:45 +10:00
parent 410e298bca
commit b0edfef6a9
2 changed files with 5 additions and 1 deletions

View File

@ -251,6 +251,10 @@ class Poller(private val configFactory: ConfigFactoryProtocol, debounceTimer: Ti
responseList.getOrNull(personalResponseIndex)?.let { rawResponse ->
if (rawResponse["code"] as? Int != 200) {
Log.e("Loki", "Batch sub-request for personal messages had non-200 response code, returned code ${(rawResponse["code"] as? Int) ?: "[unknown]"}")
// If we got a non-success response then the snode might be bad so we should try rotate
// to a different one just in case
pollNextSnode(deferred)
return@bind Promise.ofSuccess(Unit)
} else {
val body = rawResponse["body"] as? RawResponse
if (body == null) {

View File

@ -520,7 +520,7 @@ object SnodeAPI {
Log.w("Loki", "response code was not 200")
handleSnodeError(
response["code"] as? Int ?: 0,
response,
response["body"] as? Map<*, *>,
snode,
publicKey
)