-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Login] Handle correctly M_LIMIT_EXCEEDED error code #334
Conversation
// // 429, we can retry | ||
// delay(exception.getRetryDelay(1_000)) | ||
// } else | ||
if (canRetry && currentRetryCount < maxRetriesCount && exception.shouldBeRetried()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree about this change.
If I understood correctly, you commented this block about exception.error.code == MatrixError.M_LIMIT_EXCEEDED
, in order to prevent the application to be blocked until the end of the delay provided by the exception (which is 30 mins in our case). If this is true, this means canRetry
and/or exception.shouldBeRetried()
was false, which let you trigger the exception.
I think there is a bug in Element-android sdk here, we should check exception.shouldBeRetried()
and canRetry
booleans even when exception.error.code == MatrixError.M_LIMIT_EXCEEDED
About my suggestion:
- we have to check whether the login request is triggered by disabling the retry option
- we have to test the other cases where
M_LIMIT_EXCEEDED
error may be received to be sure we don't disturb them. For example when you send several messages in a room in a very short delay, you will trigger this error. I think this request (send message) enables the retry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more context the new retry policy regarding 429 has been added element-hq/element-android#3142.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And in case of 429, the SDK automatically retry, whatever the value of canRetry
@ClaireGizard After reviewing your PR, I don't think we are going in the right direction to fix this issue. |
44b0c5c
to
604ccca
Compare
604ccca
to
c10a379
Compare
#322