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

fix: Catch network connectivity exceptions #221

Merged
merged 5 commits into from
Aug 21, 2024

Conversation

izaaz
Copy link
Collaborator

@izaaz izaaz commented Aug 20, 2024

Summary

Fixes #197 and #220

The network connectivity checker can throw an exception sometimes that causes the app to crash. Wrap them around try catches, suppress exceptions and default to online in case of an error

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

Copy link
Contributor

@Mercy811 Mercy811 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Izaaz for fixing this. As it's a known issue and 99% of devices affected are Pixel devices (2/3) running android 11 according to https://issuetracker.google.com/issues/175055271. Wrapping where exceptions are thrown makes sense to me.

@izaaz izaaz removed the request for review from yuhao900914 August 21, 2024 22:12
@izaaz izaaz merged commit 1ed787b into main Aug 21, 2024
4 checks passed
@izaaz izaaz deleted the AMP-107293/network_connectivity_exception branch August 21, 2024 22:12
github-actions bot pushed a commit that referenced this pull request Aug 21, 2024
## [1.17.4](v1.17.3...v1.17.4) (2024-08-21)

### Bug Fixes

* Catch network connectivity exceptions ([#221](#221)) ([1ed787b](1ed787b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AndroidNetworkListener and AndroidNetworkConnectivityChecker are crashing on Android 11
3 participants