android / android/nowinandroid
[Bug]: NetworkMonitor not sending callback when a network loses connection
- Dominant language
- Kotlin
- Stars
- 21.8k
- Forks
- 4.6k
- Avg merge
- 19h 20m
- Merged PRs (30d)
- 2
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Is there a StackOverflow question about this issue?
- [X] I have searched StackOverflow
### What happened?
Scenario 1:
I connected to a WiFi/enabled mobile data with no internet connection. I expected to see the "You aren't connected to the internet" snackbar but it didn't appear. (I did find answer about this in StackOverflow that we should use `NetworkCapabilities.NET_CAPABILITY_VALIDATED`)
Scenario 2:
I connected to a wifi with internet connection and disabled the internet from the router. My device reports that the wifi has no connection but the app doesn't show the "You aren't connected to the internet" snackbar. I tried to use `NetworkCapabilities.NET_CAPABILITY_VALIDATED` but the result was same.
### Relevant logcat output
_No response_
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Contributor guide
Research direction
Start by locating the NetworkMonitor entry point and reviewing how network loss is reported in the two scenarios described. Reproduce the WiFi and mobile-data cases, then verify that the "You aren't connected to the internet" snackbar appears when connectivity is lost; no relevant logcat output is provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100