Invariant: a traffic reset leaves a quota-disabled client enabled everywhere. ResetTrafficByEmail and BulkResetTraffic enabled the client first and zeroed its counters afterwards. A traffic tick landing between the two still saw the client depleted and switched it off again in client_traffics, the record and settings. Update's direct record write then set the record back to enabled and the reset zeroed the counters, leaving the settings entry disabled: the client showed enabled with zero usage but was dropped from the runtime. The periodic reset job goes through ResetTrafficByEmail for every depleted client on its cycle, and a node push inside Update widens the window to seconds. Zero first, then enable: with the counters at zero the depletion predicate no longer matches, so the tick has nothing to undo. UpdateInboundClient re-adds the enabled user to the runtime itself. |
||
|---|---|---|
| .. | ||
| amneziawg | ||
| amneziawgnet | ||
| config | ||
| crypto/nodetoken | ||
| database | ||
| eventbus | ||
| logger | ||
| mtproto | ||
| pia | ||
| sub | ||
| testpg | ||
| tuic | ||
| tunnelmonitor | ||
| util | ||
| web | ||
| xray | ||