Add retry logic to bundle download [Android]#29
Add retry logic to bundle download [Android]#29ofalvai wants to merge 3 commits intoCodePushNext:masterfrom
Conversation
|
Hi! @ofalvai Thanks for your contribution! We will look into this pull request on this weekend, and get back to you! |
| connection.setConnectTimeout(30000); | ||
| connection.setReadTimeout(60000); |
There was a problem hiding this comment.
Is there any reason to set timeout as 30s and 60s? It seems to be too long for me 🤔
I agree. retry enable, retryAttempts, retryTimeout are enough I think. (FYI, currently codepushnext only supports new archi in ios and android, not window)
I don't think it's gonna be a big deal. User might experience code push loading several times if the app implements loading state, but It looks like minor things @ofalvai |
|
Thank you for the review and fixing the tests, I appreciate it. |
|
What about implementing retry mechanism on this PR ? Currently, e2e test case for retry is failed on iOS @ofalvai |
Discussion: #27
Initial draft with Android-only implementation without any complexities like configurable retries.
The main addition is
RetryHelper.java, which retries a lambda (the network download in our case) when an exception is thrown and it's deemed retryable. What is retryable: a few known Java exception classes and certain HTTP status codes.TODO
DownloadProgressCallback: with this new retry logic, thereceivedBytesfield could jump backwards if/when a retry is performed. I'm not sure how important this is, we could introduce a new field likeint attemptsin the callback.