fixed stalled requests after app resume

This commit is contained in:
2026-09-24 22:33:00 +02:00
parent 4f31e68456
commit de866b12b4
5 changed files with 34 additions and 7 deletions
@@ -16,6 +16,16 @@ class MarianumConnectApi {
static Dio dio() => _instance;
/// Drops the pooled keep-alive sockets. After a suspend the OS or a NAT
/// has usually killed them already, but dart:io only notices once a request
/// is written into one — which then hangs until [_receiveTimeout].
/// In-flight requests finish on the old adapter.
static void resetConnections() {
final stale = _instance.httpClientAdapter;
_instance.httpClientAdapter = HttpClientAdapter();
stale.close();
}
/// A fresh dio with the standard JSON options but no interceptors — used by
/// the auth queries (login/verify) that must bypass the bearer/demo
/// interceptors to avoid a re-auth loop.