[PR #6621] [MERGED] fix(tgbot): unstick the add-client wizard's inbound picker #6381

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6621
Author: @romus204
Created: 9/22/2026
Status: ✅ Merged
Merged: 9/26/2026
Merged by: @MHSanaei

Base: main ← Head: main


📝 Commits (3)

  • cfadb5e fix(tgbot): unstick the add-client wizard's inbound picker
  • 4a4231f Merge remote-tracking branch 'origin/main' into pr-6621
  • c11dfee test(tgbot): pin which inbounds the add-client picker offers

📊 Changes

2 files changed (+81 additions, -17 deletions)

View changed files

➕ internal/web/service/tgbot/tgbot_add_client_picker_test.go (+66 -0)
📝 internal/web/service/tgbot/tgbot_inbound.go (+15 -17)

📄 Description

Summary

  • Fix the add-client wizard silently doing nothing after "➕ Новый клиент": if every inbound got excluded by protocol, getInboundsAddClient still returned a valid-but-empty keyboard instead of an error, so the admin saw "choose inbound" with no buttons to tap.
  • Drop WireGuard and AmneziaWG from the wizard's protocol exclusion list. Both already auto-generate a keypair + AllowedIPs for a client with none set (defaultWireguardClients, defaultAmneziaWGClients) and already get a subscription share link (wireguard://, vpn://), so they go through the same generic ClientService.Create path VLESS/Trojan already use — the exclusion was stale, left over from before those features existed. Mixed/HTTP/Tunnel stay excluded: no per-client model.
  • De-duplicate the per-function protocol exclusion map into one shared addClientExcludedProtocols.

Why

Tapping "➕ Новый клиент" always sent the "choose inbound" message,
even when the button list ended up empty after protocol filtering.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

Screenshots / recordings

изображение

Breaking changes

No

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • 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.
  • 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/6621 **Author:** [@romus204](https://github.com/romus204) **Created:** 9/22/2026 **Status:** ✅ Merged **Merged:** 9/26/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`cfadb5e`](https://github.com/MHSanaei/3x-ui/commit/cfadb5eacdca79a50d2b941f5a7c8376cf472f4c) fix(tgbot): unstick the add-client wizard's inbound picker - [`4a4231f`](https://github.com/MHSanaei/3x-ui/commit/4a4231f03b4985efd534d9138893d2813d079b96) Merge remote-tracking branch 'origin/main' into pr-6621 - [`c11dfee`](https://github.com/MHSanaei/3x-ui/commit/c11dfeea6e9c8e8d2e25f9a3ddcea71bad970629) test(tgbot): pin which inbounds the add-client picker offers ### 📊 Changes **2 files changed** (+81 additions, -17 deletions) <details> <summary>View changed files</summary> ➕ `internal/web/service/tgbot/tgbot_add_client_picker_test.go` (+66 -0) 📝 `internal/web/service/tgbot/tgbot_inbound.go` (+15 -17) </details> ### 📄 Description ## Summary - Fix the add-client wizard silently doing nothing after "➕ Новый клиент": if every inbound got excluded by protocol, `getInboundsAddClient` still returned a valid-but-empty keyboard instead of an error, so the admin saw "choose inbound" with no buttons to tap. - Drop WireGuard and AmneziaWG from the wizard's protocol exclusion list. Both already auto-generate a keypair + AllowedIPs for a client with none set (`defaultWireguardClients`, `defaultAmneziaWGClients`) and already get a subscription share link (`wireguard://`, `vpn://`), so they go through the same generic `ClientService.Create` path VLESS/Trojan already use — the exclusion was stale, left over from before those features existed. Mixed/HTTP/Tunnel stay excluded: no per-client model. - De-duplicate the per-function protocol exclusion map into one shared `addClientExcludedProtocols`. ## Why Tapping "➕ Новый клиент" always sent the "choose inbound" message, even when the button list ended up empty after protocol filtering. ## Type of change - [x] Bug fix - [ ] New feature - [ ] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [ ] Frontend (UI / panel pages) - [ ] Backend (API endpoints, login, settings) - [ ] Xray config generation - [x] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [x] Telegram bot ## Screenshots / recordings <img width="677" height="880" alt="изображение" src="https://github.com/user-attachments/assets/16c0402a-3d9e-4b3d-a5dc-8928f8543d42" /> ## Breaking changes No ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [ ] 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. - [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:08:22 +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#6381
No description provided.