NuvioStreaming/composeApp
Mate Remias 27c646eafa
Fix debrid device-auth giving up on transient poll errors
The device-authorization poll for debrid providers (TorBox/Premiumize)
treated any thrown redeem request as a fatal error and stopped polling,
showing "Could not start sign-in". The only thrown error it tolerated was
iOS request cancellation (isCancelledHttpRequest matched NSURLErrorDomain
/ code=-999); on Android a thrown request fell through to Failed(null)
and terminated the loop.

On aggressive ROMs (OxygenOS, MIUI, ...) the OS severs a backgrounded
app's sockets and fails its DNS while the user is in the browser approving
the code, so the in-flight poll throws UnknownHostException/IOException.
That terminated the login even though approval succeeded — reproduced on
OnePlus 13 / Android 16 (issue #1409): browser shows "logged in", app shows
"Could not start sign-in".

Treat a thrown redeem as Pending and keep polling instead of failing. To
avoid polling forever when the failure is persistent (airplane mode,
captive portal) rather than a brief background blip, a monotonic-clock
watchdog (DEVICE_AUTH_MAX_POLL_DURATION) bounds the throwing path and
surfaces failure once it elapses; a response-bearing expiry still stops
the loop earlier via the Expired branch. This also removes the now-unused,
iOS-only isCancelledHttpRequest helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:46:07 +02:00
..
libs build: update quickjs-kt library AAR with JNI optimizations and leak fixes 2026-06-14 13:19:41 +03:00
src Fix debrid device-auth giving up on transient poll errors 2026-06-26 10:46:07 +02:00
build.gradle.kts feat: local db switch for development 2026-06-23 19:43:27 +05:30
proguard-rules.pro update proguard rules and bump version 2026-06-22 21:12:43 +05:30