Skip to content
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

feat: implement exponential retry mechanism for handling network errors #468

Merged
merged 5 commits into from
Jul 29, 2024

Conversation

1abhishekpandey
Copy link
Contributor

Description

  • This PR removes the existing retry mechanism for network errors and replaces it with an exponential retry mechanism with jitter. Now, retries will occur exponentially for every 4xx and 5xx status code (except 400 and 404). If the network is unavailable, retries will continue with a one-second delay.
  • The maximum limit is 5 minutes; once this limit is reached, the retry process will start over from the beginning.
  • Example sequence:
5sec, 7sec, 22 sec, 42 sec, 56 sec, 3 min 11 sec, 5 min 0 sec,
3 sec

NOTE: No event is deleted in this process.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • Version upgraded (project, README, gradle, podspec etc)
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added unit tests for the code
  • I have made corresponding changes to the documentation

@1abhishekpandey 1abhishekpandey self-assigned this Jul 25, 2024
@1abhishekpandey 1abhishekpandey requested a review from a team as a code owner July 25, 2024 07:25
@1abhishekpandey 1abhishekpandey marked this pull request as draft July 25, 2024 07:34
Replace java.util.Random with java.security.SecureRandom.
@1abhishekpandey 1abhishekpandey marked this pull request as ready for review July 25, 2024 07:45
Copy link

@1abhishekpandey 1abhishekpandey merged commit e07e2cf into develop Jul 29, 2024
7 checks passed
@1abhishekpandey 1abhishekpandey deleted the feature/sdk-2094-android-implementation branch July 29, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants