[PR #4317] [MERGED] fix: auto-renew does not re-enable client (settings JSON c["enable"] not reset) #5652

Closed
opened 2026-10-31 20:48:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4317
Author: @abdalrahmanx9
Created: 5/12/2026
Status: ✅ Merged
Merged: 5/12/2026
Merged by: @MHSanaei

Base: main ← Head: fix/auto-renew-re-enable-client


📝 Commits (1)

  • c61dbdd fix: auto-renew must re-enable client in inbound settings JSON

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 web/service/inbound.go (+1 -0)

📄 Description

Since v2.9.4 (commit 6099a07f), disableInvalidClients writes c["enable"] = false into the inbound settings JSON when a client hits its traffic/expiry limit and gets disabled. This JSON field is consumed by the Xray config generator (web/service/xray.go:148) as a "manual disabled flag."

autoRenewClients only reset the client_traffics.enable column back to true — it never flipped the corresponding c["enable"] field in the settings JSON. So after auto-renew:

  • client_traffics.enable = true (correct)
  • inbounds.settings.clients[].enable = false (stale from earlier disable)

The Xray config generator checks both sources, and since the JSON still says false, the client is excluded from the runtime config — it stays permanently disabled even after renewal.

Fix: Added c["enable"] = true in autoRenewClients right after traffics[traffic_index].Enable = true, so the inbound settings JSON is updated in sync with the database row when a client is re-enabled.

Fixes: #4310


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/4317 **Author:** [@abdalrahmanx9](https://github.com/abdalrahmanx9) **Created:** 5/12/2026 **Status:** ✅ Merged **Merged:** 5/12/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/auto-renew-re-enable-client` --- ### 📝 Commits (1) - [`c61dbdd`](https://github.com/MHSanaei/3x-ui/commit/c61dbdd3e0d91338229e95b3c114885b412d58c9) fix: auto-renew must re-enable client in inbound settings JSON ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `web/service/inbound.go` (+1 -0) </details> ### 📄 Description Since v2.9.4 (commit `6099a07f`), `disableInvalidClients` writes `c["enable"] = false` into the inbound settings JSON when a client hits its traffic/expiry limit and gets disabled. This JSON field is consumed by the Xray config generator (`web/service/xray.go:148`) as a "manual disabled flag." `autoRenewClients` only reset the `client_traffics.enable` column back to `true` — it never flipped the corresponding `c["enable"]` field in the settings JSON. So after auto-renew: - `client_traffics.enable` = `true` (correct) - `inbounds.settings.clients[].enable` = `false` (stale from earlier disable) The Xray config generator checks both sources, and since the JSON still says `false`, the client is excluded from the runtime config — it stays permanently disabled even after renewal. **Fix:** Added `c["enable"] = true` in `autoRenewClients` right after `traffics[traffic_index].Enable = true`, so the inbound settings JSON is updated in sync with the database row when a client is re-enabled. **Fixes:** #4310 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:48:24 +07:00
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#5652
No description provided.