mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-24 03:47:15 +00:00
326009e9d3
autoRenewClients collects every expired client that carries a reset interval, but three of them never reach a new window: one may be missing from its inbound's settings, one may resolve to no whole interval, and one may still land in the past once the reset cap truncates the catch-up. All three keep their counters and their expiry on purpose. clearGlobalTraffic was still called with the full candidate list, so those three lost their cross-panel rows while their local counters stayed. The next push recreates the rows, and the expiry branch of the depletion check cuts these clients regardless, so nothing is served past its limit — but between the delete and the next push the cross-panel view under-reports them, and since the expiry never advances that repeats on every poll. Pass only the clients whose counters this pass reset. clearGlobalTraffic already early-returns on an empty list, so a poll that renews nobody stays a no-op rather than deleting every row. The renewed count returned to the caller now counts the same set, instead of reporting candidates as renewals. Tests cover both directions: a capped catch-up keeps its rows, and an actually renewed client still loses them, since stale pushed totals would otherwise re-deplete the fresh window at once.