[PR #7036] [CLOSED] fix(api): partial client update keeps fields it does not mention #6593

Closed
opened 2026-11-02 04:09:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/7036
Author: @Dv2Corn
Created: 11/1/2026
Status: ❌ Closed

Base: main ← Head: fix/client-partial-update


📝 Commits (4)

  • 2fe0212 clients: partial API update keeps fields it does not mention
  • 1913213 fix(api): keep each inbound's flow on a partial client update
  • 9e51f6a fix(clients): send a cleared reverse tag as null
  • 6cbad55 docs(api): describe partial semantics of POST /clients/update

📊 Changes

14 files changed (+466 additions, -46 deletions)

View changed files

📝 docs/content/docs/en/reference/api/clients.mdx (+13 -11)
📝 docs/content/docs/fa/reference/api/clients.mdx (+7 -7)
📝 docs/content/docs/ru/reference/api/clients.mdx (+7 -7)
📝 docs/content/docs/zh/reference/api/clients.mdx (+6 -6)
📝 docs/public/openapi.json (+2 -2)
📝 frontend/public/openapi.json (+2 -2)
📝 frontend/src/pages/api-docs/endpoints.ts (+2 -2)
📝 frontend/src/pages/clients/ClientFormModal.tsx (+3 -3)
➕ frontend/src/test/client-form-reverse.test.tsx (+64 -0)
📝 internal/web/controller/client.go (+3 -6)
➕ internal/web/controller/client_partial_update_test.go (+53 -0)
📝 internal/web/service/client_crud.go (+17 -0)
➕ internal/web/service/client_partial_update.go (+131 -0)
➕ internal/web/service/client_partial_update_test.go (+156 -0)

📄 Description

In v3.11.0, POST /panel/api/clients/update/:email with a body that only sets expiryTime disables the client (enable=false) and resets limitIp, totalGB, tgId, comment, group, flow, the renewal settings and limitHwid. Bots that extend a subscription this way silently switch the customer off.

Fields missing from the body are now taken from the stored record; an explicit zero or empty value still clears a field. WireGuard/AmneziaWG keys were already carried over — a test pins that too.

Tests: internal/web/service/client_partial_update_test.go (fails without the fix); go test ./internal/web/service/... passes.


🔄 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/7036 **Author:** [@Dv2Corn](https://github.com/Dv2Corn) **Created:** 11/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/client-partial-update` --- ### 📝 Commits (4) - [`2fe0212`](https://github.com/MHSanaei/3x-ui/commit/2fe0212e9fb23f671d8683cf968083f1e370837b) clients: partial API update keeps fields it does not mention - [`1913213`](https://github.com/MHSanaei/3x-ui/commit/1913213c8c49087340d73884ac25401dd6a3c920) fix(api): keep each inbound's flow on a partial client update - [`9e51f6a`](https://github.com/MHSanaei/3x-ui/commit/9e51f6af3f73e816fe0dcdc75460aa5dc98ec8d8) fix(clients): send a cleared reverse tag as null - [`6cbad55`](https://github.com/MHSanaei/3x-ui/commit/6cbad55e30e7ab45f48f37e6c43019e08e94adf2) docs(api): describe partial semantics of POST /clients/update ### 📊 Changes **14 files changed** (+466 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/en/reference/api/clients.mdx` (+13 -11) 📝 `docs/content/docs/fa/reference/api/clients.mdx` (+7 -7) 📝 `docs/content/docs/ru/reference/api/clients.mdx` (+7 -7) 📝 `docs/content/docs/zh/reference/api/clients.mdx` (+6 -6) 📝 `docs/public/openapi.json` (+2 -2) 📝 `frontend/public/openapi.json` (+2 -2) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+2 -2) 📝 `frontend/src/pages/clients/ClientFormModal.tsx` (+3 -3) ➕ `frontend/src/test/client-form-reverse.test.tsx` (+64 -0) 📝 `internal/web/controller/client.go` (+3 -6) ➕ `internal/web/controller/client_partial_update_test.go` (+53 -0) 📝 `internal/web/service/client_crud.go` (+17 -0) ➕ `internal/web/service/client_partial_update.go` (+131 -0) ➕ `internal/web/service/client_partial_update_test.go` (+156 -0) </details> ### 📄 Description In v3.11.0, `POST /panel/api/clients/update/:email` with a body that only sets `expiryTime` disables the client (`enable=false`) and resets `limitIp`, `totalGB`, `tgId`, `comment`, `group`, `flow`, the renewal settings and `limitHwid`. Bots that extend a subscription this way silently switch the customer off. Fields missing from the body are now taken from the stored record; an explicit zero or empty value still clears a field. WireGuard/AmneziaWG keys were already carried over — a test pins that too. Tests: `internal/web/service/client_partial_update_test.go` (fails without the fix); `go test ./internal/web/service/...` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:09:55 +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#6593
No description provided.