talk-android/app
Marcel Hibbe 6e1114d4d8
fix TooManyRequestsException
By using
networkMonitor.isOnline.first()
the function
unregisterNetworkCallback
was triggered, which sometimes causes the ConnectivityManager$TooManyRequestsException.

So each time isOnline.first() was called, the callbackFlow would:
- Register a new NetworkCallback.
- Emit a value and cancel the flow.
- Unregister the NetworkCallback.

The exception was:
Exception android.net.ConnectivityManager$TooManyRequestsException:
  at android.net.ConnectivityManager.convertServiceException (ConnectivityManager.java:3771)
  at android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:3960)
  at android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:3967)
  at android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4349)
  at android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4319)
  at com.nextcloud.talk.data.network.NetworkMonitorImpl$isOnline$1.invokeSuspend (NetworkMonitorImpl.kt:61)

To fix this, the cold flow from callbackFlow is converted to a StateFlow.

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
2025-01-16 13:50:51 +01:00
..
schemas/com.nextcloud.talk.data.source.local.TalkDatabase save "silent" in chat messages (incl DB) 2025-01-10 12:32:32 +01:00
src fix TooManyRequestsException 2025-01-16 13:50:51 +01:00
build.gradle Weekly 21.0.0 Alpha 09 2025-01-13 03:12:47 +00:00
lint.xml
proguard-rules.pro