mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-27 01:22:10 +03:00
maybeClearRecoveredQuotaState() only guarded against clearing a still-future rateLimitedUntil inside the lastErrorType === "quota_exhausted" branch. Any other lastErrorType (rate_limited, free_quota_exhausted, etc.) skipped straight to clearRecoveredProviderState() with no future-cooldown check at all, so a multi-day cooldown got wiped on the next quota sync a few minutes later — a self-restart loop burning real upstream calls against a known-exhausted connection. Added a universal fallback guard for every other lastErrorType: a future rateLimitedUntil is a hard statement from whatever handler persisted it, and no quota poll finding some usable window elsewhere may overrule it. Also fixed a pre-existing test that encoded the same defect class with a shorter window (asserted a still-future cooldown got cleared by a successful refresh) and added a regression test pinning the new guard.