[PR #6265] [MERGED] feat(clients): allow removing a single HWID device #6202

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6265
Author: @kuzzrus
Created: 8/19/2026
Status: ✅ Merged
Merged: 8/21/2026
Merged by: @MHSanaei

Base: main ← Head: upstream-pr/hwid-single-delete


📝 Commits (10+)

  • 7217f60 feat(clients): allow removing a single HWID device
  • 7ca9b4e feat(clients): surface HWID limit + device log in the client info card
  • c6bb087 i18n: add HWID single-delete strings to all 13 locales
  • 78c185e fix(clients): address automated review of HWID single-delete PR
  • e489f09 chore: retrigger CI (previous run stuck installing Playwright Chromium)
  • b7786ff Merge branch 'main' into upstream-pr/hwid-single-delete
  • 7a1ca9e fix(clients): address the arbiter review on the HWID single-delete PR
  • 6950418 Merge branch 'main' into upstream-pr/hwid-single-delete
  • 2551c53 fix(clients): trim HWID list comment blocks to 2 lines
  • 1aaeae4 chore: retrigger CI

📊 Changes

25 files changed (+663 additions, -119 deletions)

View changed files

📝 docs/content/docs/en/reference/api/clients.mdx (+20 -1)
📝 docs/public/openapi.json (+144 -0)
📝 frontend/public/openapi.json (+50 -0)
➕ frontend/src/components/clients/ClientHwidList.tsx (+129 -0)
➕ frontend/src/hooks/useClientHwids.ts (+75 -0)
➕ frontend/src/lib/clients/hwid-log.ts (+21 -0)
📝 frontend/src/pages/api-docs/endpoints.ts (+10 -0)
📝 frontend/src/pages/clients/ClientFormModal.tsx (+28 -118)
📝 frontend/src/pages/clients/ClientInfoModal.tsx (+52 -0)
📝 internal/web/controller/client.go (+14 -0)
📝 internal/web/service/client_hwid.go (+21 -0)
📝 internal/web/service/client_hwid_test.go (+47 -0)
📝 internal/web/translation/ar-EG.json (+4 -0)
📝 internal/web/translation/en-US.json (+4 -0)
📝 internal/web/translation/es-ES.json (+4 -0)
📝 internal/web/translation/fa-IR.json (+4 -0)
📝 internal/web/translation/id-ID.json (+4 -0)
📝 internal/web/translation/ja-JP.json (+4 -0)
📝 internal/web/translation/pt-BR.json (+4 -0)
📝 internal/web/translation/ru-RU.json (+4 -0)

...and 5 more files

📄 Description

Summary

Adds the ability to remove a single registered HWID device, instead of only "list" and "clear all", in both the client edit form's HWID modal and the (previously IP-limit-only) client info card.

Why

Closes #6245. Once a client hits its HWID limit, the only way to free up a slot today is to clear every device and wait for the ones you want to keep to re-register on their next subscription fetch — there's no way to drop just the one device you no longer need. This is the exact scenario described in the issue: sharing a subscription with someone new when you're already at the device cap.

Type of change

  • New feature

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)

How was this tested?

internal/web/service/internal/web/controller transitively import internal/database (CGO/sqlite3), which I wasn't able to compile in my local environment — verified with gofmt and go build ./... (fails only at the pre-existing CGO boundary, no new errors) instead. go build ./.../backend tests should be confirmed by CI.

Frontend verified for real: tsc --noEmit, oxlint, oxfmt --check, and the full vitest suite are all clean (the only 2 failures in the suite are pre-existing and environment-specific to this Windows dev machine — a POSIX-only execFileSync path in input-number-guard.test.ts and a default-locale-dependent toLocaleString() assertion in a Storybook story — neither touches anything in this diff).

Manually tested end-to-end against a real running instance (screenshots below): opened a client with two registered HWID devices, deleted one from the client info card's new "HWID Devices" modal, confirmed it disappeared from the list and the counter updated, and confirmed the remaining device and its metadata (model, OS, first/last seen, user agent) were untouched.

Screenshots / recordings

Снимок Снимок1

Breaking changes

None.

Checklist

  • I tested the change locally and confirmed the described behavior. (frontend: yes, locally and against a live instance; backend: blocked by the local CGO/sqlite3 gap above, not skipped by choice)
  • I added or updated tests for the new behavior (when applicable). Added TestDeleteClientHwid (internal/web/service/client_hwid_test.go), covering the happy path, rejecting a delete against another client's sub_id, and rejecting an unknown device id.
  • go build ./... and the test suite pass locally. (same CGO blocker; should be green in CI)
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • I updated the Wiki / README / API docs if user-facing behavior changed. (added the new endpoint to the API docs page)
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🔄 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/6265 **Author:** [@kuzzrus](https://github.com/kuzzrus) **Created:** 8/19/2026 **Status:** ✅ Merged **Merged:** 8/21/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `upstream-pr/hwid-single-delete` --- ### 📝 Commits (10+) - [`7217f60`](https://github.com/MHSanaei/3x-ui/commit/7217f60b60a2d5e38a91dcca075e9fd2e667d285) feat(clients): allow removing a single HWID device - [`7ca9b4e`](https://github.com/MHSanaei/3x-ui/commit/7ca9b4ea4127f7de0a8c85913e67dbe62d623138) feat(clients): surface HWID limit + device log in the client info card - [`c6bb087`](https://github.com/MHSanaei/3x-ui/commit/c6bb0875890b6917e538fcba95f11e3d374b1276) i18n: add HWID single-delete strings to all 13 locales - [`78c185e`](https://github.com/MHSanaei/3x-ui/commit/78c185e484536a548af48fe822729db44add9dcb) fix(clients): address automated review of HWID single-delete PR - [`e489f09`](https://github.com/MHSanaei/3x-ui/commit/e489f099605195135a017ea3457622ca08437446) chore: retrigger CI (previous run stuck installing Playwright Chromium) - [`b7786ff`](https://github.com/MHSanaei/3x-ui/commit/b7786ffd61713a1c658096a8315b46a7c41653f2) Merge branch 'main' into upstream-pr/hwid-single-delete - [`7a1ca9e`](https://github.com/MHSanaei/3x-ui/commit/7a1ca9e2130d2ed9170647c6676dcd3b159495e8) fix(clients): address the arbiter review on the HWID single-delete PR - [`6950418`](https://github.com/MHSanaei/3x-ui/commit/6950418cc76747aeca25cc474b1c58597a87a280) Merge branch 'main' into upstream-pr/hwid-single-delete - [`2551c53`](https://github.com/MHSanaei/3x-ui/commit/2551c5303897d0b00bb55e76a70d5a5264c4f616) fix(clients): trim HWID list comment blocks to 2 lines - [`1aaeae4`](https://github.com/MHSanaei/3x-ui/commit/1aaeae4dc0d6ec5524c5407d21387f895259b064) chore: retrigger CI ### 📊 Changes **25 files changed** (+663 additions, -119 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/en/reference/api/clients.mdx` (+20 -1) 📝 `docs/public/openapi.json` (+144 -0) 📝 `frontend/public/openapi.json` (+50 -0) ➕ `frontend/src/components/clients/ClientHwidList.tsx` (+129 -0) ➕ `frontend/src/hooks/useClientHwids.ts` (+75 -0) ➕ `frontend/src/lib/clients/hwid-log.ts` (+21 -0) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+10 -0) 📝 `frontend/src/pages/clients/ClientFormModal.tsx` (+28 -118) 📝 `frontend/src/pages/clients/ClientInfoModal.tsx` (+52 -0) 📝 `internal/web/controller/client.go` (+14 -0) 📝 `internal/web/service/client_hwid.go` (+21 -0) 📝 `internal/web/service/client_hwid_test.go` (+47 -0) 📝 `internal/web/translation/ar-EG.json` (+4 -0) 📝 `internal/web/translation/en-US.json` (+4 -0) 📝 `internal/web/translation/es-ES.json` (+4 -0) 📝 `internal/web/translation/fa-IR.json` (+4 -0) 📝 `internal/web/translation/id-ID.json` (+4 -0) 📝 `internal/web/translation/ja-JP.json` (+4 -0) 📝 `internal/web/translation/pt-BR.json` (+4 -0) 📝 `internal/web/translation/ru-RU.json` (+4 -0) _...and 5 more files_ </details> ### 📄 Description ## Summary Adds the ability to remove a single registered HWID device, instead of only "list" and "clear all", in both the client edit form's HWID modal and the (previously IP-limit-only) client info card. ## Why Closes #6245. Once a client hits its HWID limit, the only way to free up a slot today is to clear every device and wait for the ones you want to keep to re-register on their next subscription fetch — there's no way to drop just the one device you no longer need. This is the exact scenario described in the issue: sharing a subscription with someone new when you're already at the device cap. ## Type of change - [x] New feature ## Areas affected - [x] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) ## How was this tested? `internal/web/service`/`internal/web/controller` transitively import `internal/database` (CGO/sqlite3), which I wasn't able to compile in my local environment — verified with `gofmt` and `go build ./...` (fails only at the pre-existing CGO boundary, no new errors) instead. `go build ./...`/backend tests should be confirmed by CI. Frontend verified for real: `tsc --noEmit`, `oxlint`, `oxfmt --check`, and the full `vitest` suite are all clean (the only 2 failures in the suite are pre-existing and environment-specific to this Windows dev machine — a POSIX-only `execFileSync` path in `input-number-guard.test.ts` and a default-locale-dependent `toLocaleString()` assertion in a Storybook story — neither touches anything in this diff). Manually tested end-to-end against a real running instance (screenshots below): opened a client with two registered HWID devices, deleted one from the client info card's new "HWID Devices" modal, confirmed it disappeared from the list and the counter updated, and confirmed the remaining device and its metadata (model, OS, first/last seen, user agent) were untouched. ## Screenshots / recordings <img width="665" height="568" alt="Снимок" src="https://github.com/user-attachments/assets/836c193d-8498-4161-9ee4-59c4b4dab8bb" /> <img width="657" height="359" alt="Снимок1" src="https://github.com/user-attachments/assets/3c3bd139-11ad-4897-9bb6-6b5319944805" /> ## Breaking changes None. ## Checklist - [ ] I tested the change locally and confirmed the described behavior. (frontend: yes, locally and against a live instance; backend: blocked by the local CGO/sqlite3 gap above, not skipped by choice) - [x] I added or updated tests for the new behavior (when applicable). Added `TestDeleteClientHwid` (`internal/web/service/client_hwid_test.go`), covering the happy path, rejecting a delete against another client's `sub_id`, and rejecting an unknown device id. - [ ] `go build ./...` and the test suite pass locally. (same CGO blocker; should be green in CI) - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [x] I updated the Wiki / README / API docs if user-facing behavior changed. (added the new endpoint to the API docs page) - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:05 +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#6202
No description provided.