-
-
Notifications
You must be signed in to change notification settings - Fork 45
Better error handling and retry mechanism for integrity token provider #3214
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
Conversation
app/src/org/commcare/android/integrity/IntegrityTokenApiRequestHelper.kt
Outdated
Show resolved
Hide resolved
f07b51e to
a73884c
Compare
| callback: IntegrityTokenCallback, | ||
| hasRetried: Boolean | ||
| ) { | ||
| if (exception is StandardIntegrityException && exception.errorCode == -19 && !hasRetried) { |
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.
@shubham1g5 Google doc says same retry for error code =-18 also, not sure if we want to handle that case too.
Also, if we can compare like exception.errorCode ==INTEGRITY_TOKEN_PROVIDER_INVALID
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.
thanks, this prompted me to handle other common error codes as well and provide more dintinctive error messages, please have a look again.
| callback: IntegrityTokenCallback, | ||
| hasRetried: Boolean | ||
| ) { | ||
| if (exception is StandardIntegrityException && exception.errorCode == -19 && !hasRetried) { |
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.
just for my reference want to know from where -19 is coming is there any doc related to this
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.
look at the failure logs attached in the PR description
a73884c to
db16702
Compare
|
@shubham1g5 Changes looks good to me. Just small thing if we can put some logger here also |
|
@Jignesh-dimagi good catch, added here |
Product Description/
https://dimagi.atlassian.net/browse/CI-115
Technical Summary
Noticing a few Firebase logs that implies that the integrity token provider is getting stale and we need to re-prepare in response for this error
Failure Logs:
There are no details available in Google docs around why and when the token provider goes invalid, searching around the internet it seems like the behavior can vary device to device quite greatly and it's possible for the provider to go invalid in a matter of seconds.
Labels and Review