[PR #4617] [CLOSED] Fix Telegram bot client lookup for multi-node inbounds #5727

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4617
Author: @Serega71RUS
Created: 5/28/2026
Status: ❌ Closed

Base: main ← Head: fix/tg-bot-multinode


📝 Commits (3)

  • c64cdbb Fix Telegram bot client lookup for multi-node inbounds
  • 11bd082 Fix Telegram bot client lookup without traffic rows
  • c14cda9 Merge branch 'main' into fix/tg-bot-multinode

📊 Changes

2 files changed (+303 additions, -26 deletions)

View changed files

📝 web/service/inbound.go (+186 -26)
➕ web/service/tgbot_client_traffic_test.go (+117 -0)

📄 Description

Summary

Fix Telegram bot client lookup for multi-node synchronized inbounds.

Previously, Telegram bot could not find client configurations attached to node-synchronized inbounds and returned:
Your configuration is not found!

This change updates Telegram client lookup logic to correctly process synchronized multi-node inbound clients.

Why

In multi-node setups, Telegram bot lookup logic searched inbound client data incorrectly and failed to collect synchronized clients from sub-nodes.

As a result:

  • Telegram users could not receive their subscription/configuration via bot commands
  • /start returned Your configuration is not found!
  • Telegram integration worked only for local master-node clients

This fix allows Telegram bot to properly resolve clients attached to synchronized node inbounds.

Type of change

  • Bug fix

Areas affected

  • Backend (API endpoints, login, settings)
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

Tested on a real multi-node environment:

  1. Master panel + 3 sub-nodes
  2. Created synchronized inbounds across nodes
  3. Added clients with Telegram ChatID
  4. Started Telegram bot using /start

Before fix:

  • bot returned Your configuration is not found!

After fix:

  • bot correctly returned client configuration/subscription

Additional verification:

  • x-ui service starts correctly
  • Telegram bot authorization works normally
  • existing subscriptions continue working
  • multi-node synchronization still works correctly

Added automated test coverage for Telegram bot client lookup logic.

Screenshots / recordings

N/A

Breaking changes

None

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 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/4617 **Author:** [@Serega71RUS](https://github.com/Serega71RUS) **Created:** 5/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/tg-bot-multinode` --- ### 📝 Commits (3) - [`c64cdbb`](https://github.com/MHSanaei/3x-ui/commit/c64cdbb0ed7e9f61afe4ff02f2adbec6ffdec998) Fix Telegram bot client lookup for multi-node inbounds - [`11bd082`](https://github.com/MHSanaei/3x-ui/commit/11bd082d8f886de54b1d28331bd1ac9fa2393491) Fix Telegram bot client lookup without traffic rows - [`c14cda9`](https://github.com/MHSanaei/3x-ui/commit/c14cda9ebe8cac47bf1629e2a53b3e827f0d3653) Merge branch 'main' into fix/tg-bot-multinode ### 📊 Changes **2 files changed** (+303 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `web/service/inbound.go` (+186 -26) ➕ `web/service/tgbot_client_traffic_test.go` (+117 -0) </details> ### 📄 Description ## Summary Fix Telegram bot client lookup for multi-node synchronized inbounds. Previously, Telegram bot could not find client configurations attached to node-synchronized inbounds and returned: `Your configuration is not found!` This change updates Telegram client lookup logic to correctly process synchronized multi-node inbound clients. ## Why In multi-node setups, Telegram bot lookup logic searched inbound client data incorrectly and failed to collect synchronized clients from sub-nodes. As a result: * Telegram users could not receive their subscription/configuration via bot commands * `/start` returned `Your configuration is not found!` * Telegram integration worked only for local master-node clients This fix allows Telegram bot to properly resolve clients attached to synchronized node inbounds. ## Type of change * [x] Bug fix ## Areas affected * [x] Backend (API endpoints, login, settings) * [x] Multi-node (sub-nodes) * [x] Telegram bot ## How was this tested? Tested on a real multi-node environment: 1. Master panel + 3 sub-nodes 2. Created synchronized inbounds across nodes 3. Added clients with Telegram ChatID 4. Started Telegram bot using `/start` Before fix: * bot returned `Your configuration is not found!` After fix: * bot correctly returned client configuration/subscription Additional verification: * x-ui service starts correctly * Telegram bot authorization works normally * existing subscriptions continue working * multi-node synchronization still works correctly Added automated test coverage for Telegram bot client lookup logic. ## Screenshots / recordings N/A ## Breaking changes None ## 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. * [x] For frontend changes: `npm run build` pass. * [x] 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:03:38 +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#5727
No description provided.