fix(providers): Treat a 429 as busy, not as a plain panel or a dead provider #37
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pool-429"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What was wrong
The pool allows 60
player_api.phpcalls a minute per login and answers the rest with HTTP 429 andRetry-After: 60. The app read that 429 two wrong ways:pool_info: a 429 was cached as the answer "plain panel" for the rest of the app run. Retry, stop, sources, live game info and the shorter guide (guide_window) stayed off until the app was restarted.What changed
XtreamClient.kt:PoolCheckgetsretryAfterMs, set from a 429'sRetry-After(seconds or an HTTP date; 1 minute when it names none). A 429 onreachable()that asks to wait 2 minutes or less counts as reachable. A longer wait, like the pool's 15-minute lockout after repeated bad passwords, still counts as down.ProviderRepository.kt: a 429 onpool_infocounts as plain only for that wait, kept between 1 and 15 minutes, and thenpool_infois asked again, the same way a timeout already worked. A real answer is still kept for the app run.Verified
testDebugUnitTest(629 tests),lintDebugandassembleDebugpass.PoolFeaturesCacheTest.ktadds the 429 cases:Retry-Afterin seconds, missing, too short, too long, as a date, and a 503 still not being cached.XtreamReachableTest.ktcovers an accepted login, a refused login, a 503, short 429s and the 15-minute lockout.pool_infocalls, then 429), so the app launched straight into 429s. Temporary logging, removed before commit.mainpool_infoat launchNot changed
pool_infocounts as plain, a channel list downloaded then has its Live Now games stripped, and that list stays fresh in the channel cache for 10 minutes. That's how apool_infotimeout already worked.