[GH-ISSUE #7039] [Question]: Can the switch be automatically turned on upon automatic data reset? #5659

Closed
opened 2026-11-02 04:02:20 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @xuexiaokang on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/7039

What are you trying to do?

Can the switch be automatically turned on upon automatic data reset?
Currently, after data depletion triggers switch-off, the switch stays off after the data quota resets. We need auto-enable of the switch together with data reset.

What have you already tried?

No response

3x-ui version

3.10.2

How did you install 3x-ui?

install.sh script

Operating system

No response

Screenshots or config snippets

No response

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
Originally created by @xuexiaokang on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/7039 ### What are you trying to do? Can the switch be automatically turned on upon automatic data reset? Currently, after data depletion triggers switch-off, the switch stays off after the data quota resets. We need auto-enable of the switch together with data reset. ### What have you already tried? _No response_ ### 3x-ui version 3.10.2 ### How did you install 3x-ui? install.sh script ### Operating system _No response_ ### Screenshots or config snippets _No response_ ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
bsakaguchi 2026-11-02 04:02:20 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2026):

Yes. Updating from 3.10.2 to v3.11.0 gives you this. In that release, when the scheduled traffic reset runs, it also turns back on any client or inbound that was switched off only because it ran out of data.

Two commits did this, and both shipped first in v3.11.0. Neither is in v3.10.2:

  • 1dbb3743 fix(traffic): re-enable quota-disabled clients on inbound and reset-all resets (#6833)
  • aedd8fac fix(traffic): re-enable a quota-disabled inbound on its periodic reset (#6834)

What gets switched back on (internal/web/job/periodic_traffic_reset_job.go):

  1. Clients in an inbound with a reset schedule. ResetAllClientTraffics (internal/web/service/client_traffic.go:127) first lists the disabled clients that used up their quota (quotaDisabledEmails, internal/web/service/client_crud.go:154). It zeroes their traffic, then re-enables them:
    if _, needRestart, enableErr = s.BulkSetEnable(inboundSvc, restore, true); enableErr != nil {
    
  2. Clients with their own reset cycle. The job skips only clients that are disabled but not depleted (periodic_traffic_reset_job.go:157). ResetTrafficByEmail then sets updated.Enable = true once the counters are zero (client_traffic.go:47-59).
  3. The inbound itself, if its own Total cap switched it off:
    return !ib.Enable && ib.NodeID == nil && ib.Total > 0 && ib.Up+ib.Down >= ib.Total &&
    	(ib.ExpiryTime <= 0 || ib.ExpiryTime > nowMs)
    
    (periodic_traffic_reset_job.go:48-51). A successful reset is then followed by SetInboundEnable(inbound.Id, true) (line 107).

What stays off, on purpose:

  • A client or inbound you switched off by hand. "Depleted" means c.Total > 0 && c.Used >= c.Total (client_crud.go:129), so one that still has quota left counts as switched off manually and is left alone (comment at periodic_traffic_reset_job.go:155-156).
  • An inbound whose expiry time has passed.
  • For the inbound itself: only inbounds on this panel (ib.NodeID == nil). Clients on node inbounds are still reset and re-enabled through the client path.

After you update, set Traffic Reset on the inbound or client (daily, weekly, monthly, etc.). Your depleted clients should then come back on by themselves at the next reset. If one is still off after a reset on v3.11.0, please post the inbound's Total/Up/Down/ExpiryTime and that client's Total/used/Enable values as text.

Verdict: Already fixed

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:6555019182 --> @github-actions[bot] commented on GitHub (Nov 1, 2026): Yes. Updating from 3.10.2 to **v3.11.0** gives you this. In that release, when the scheduled traffic reset runs, it also turns back on any client or inbound that was switched off only because it ran out of data. Two commits did this, and both shipped first in `v3.11.0`. Neither is in `v3.10.2`: - `1dbb3743` fix(traffic): re-enable quota-disabled clients on inbound and reset-all resets (#6833) - `aedd8fac` fix(traffic): re-enable a quota-disabled inbound on its periodic reset (#6834) **What gets switched back on** (`internal/web/job/periodic_traffic_reset_job.go`): 1. **Clients in an inbound with a reset schedule.** `ResetAllClientTraffics` (`internal/web/service/client_traffic.go:127`) first lists the disabled clients that used up their quota (`quotaDisabledEmails`, `internal/web/service/client_crud.go:154`). It zeroes their traffic, then re-enables them: ```go if _, needRestart, enableErr = s.BulkSetEnable(inboundSvc, restore, true); enableErr != nil { ``` 2. **Clients with their own reset cycle.** The job skips only clients that are disabled but *not* depleted (`periodic_traffic_reset_job.go:157`). `ResetTrafficByEmail` then sets `updated.Enable = true` once the counters are zero (`client_traffic.go:47-59`). 3. **The inbound itself**, if its own `Total` cap switched it off: ```go return !ib.Enable && ib.NodeID == nil && ib.Total > 0 && ib.Up+ib.Down >= ib.Total && (ib.ExpiryTime <= 0 || ib.ExpiryTime > nowMs) ``` (`periodic_traffic_reset_job.go:48-51`). A successful reset is then followed by `SetInboundEnable(inbound.Id, true)` (line 107). **What stays off, on purpose:** - A client or inbound you switched off by hand. "Depleted" means `c.Total > 0 && c.Used >= c.Total` (`client_crud.go:129`), so one that still has quota left counts as switched off manually and is left alone (comment at `periodic_traffic_reset_job.go:155-156`). - An inbound whose expiry time has passed. - For the inbound itself: only inbounds on this panel (`ib.NodeID == nil`). Clients on node inbounds are still reset and re-enabled through the client path. After you update, set **Traffic Reset** on the inbound or client (daily, weekly, monthly, etc.). Your depleted clients should then come back on by themselves at the next reset. If one is still off after a reset on v3.11.0, please post the inbound's `Total`/`Up`/`Down`/`ExpiryTime` and that client's `Total`/used/`Enable` values as text. Verdict: Already fixed *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#5659
No description provided.