[GH-ISSUE #4859] [Bug]: All inbounds show clients as active #3390

Closed
opened 2026-10-31 20:32:06 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @JohniGo76 on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4859

Describe the bug

When configuring multiple inbound connections for a client, it's not clear which inbound connection they're connected to. All are shown as active.

Image

How to reproduce the problem

  1. Add a client with multiple inbounds.
  2. Connect as a client to any of the inbounds.
  3. View clients online in the Inbounds panel.

Expected behavior

  1. For each inbound, display only the list of connected clients (as it worked before).
  2. In the Clients panel, display Active Inbound in a separate column or mark active in the Attached inbounds column.

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.2.26

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

Which parts of the panel are affected?

Frontend (UI / panel pages)

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @JohniGo76 on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4859 ### Describe the bug When configuring multiple inbound connections for a client, it's not clear which inbound connection they're connected to. All are shown as active. <img width="1300" height="432" alt="Image" src="https://github.com/user-attachments/assets/2ea596de-574b-4c85-af64-9b568f6dbdd2" /> ### How to reproduce the problem 1. Add a client with multiple inbounds. 2. Connect as a client to any of the inbounds. 3. View clients online in the Inbounds panel. ### Expected behavior 1. For each inbound, display only the list of connected clients (as it worked before). 2. In the Clients panel, display Active Inbound in a separate column or mark active in the Attached inbounds column. ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.2.26 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### Which parts of the panel are affected? Frontend (UI / panel pages) ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:32:06 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jun 3, 2026):

Thanks for the detailed report. This is a confirmed bug introduced in v3.1.0 when multi-inbound client support landed (#4469), and it differs from the cross-node bleeding fixed in #4809.

Root cause

Xray's stats API keys client traffic by email only — the counter names are user>>>email>>>traffic>>>downlink/uplink — with no inbound attribution. There is no per-inbound breakdown for user-level traffic. The polling job (web/job/xray_traffic_job.go) therefore builds activeEmails as a flat list of emails that had any traffic delta this tick, regardless of which inbound the traffic passed through. Those emails are stored in the local online set (xray/process.go → onlineClients), keyed by node (node 0 = local panel).

The frontend rollup (frontend/src/pages/inbounds/useInbounds.ts, rollupClients) marks a client online for a given inbound if nodeOnline.has(client.email) — it only checks the node bucket, not which specific inbound the client is connected to. Because the node bucket contains all active emails regardless of inbound, every inbound that lists the client shows them as online.

Example:

  • Client alice@example.com is attached to Inbound A and Inbound B (same panel, node 0).
  • She connects to Inbound A → Xray increments user>>>alice@example.com>>>traffic>>>downlink.
  • activeEmails includes alice@example.com.
  • The node-0 online set includes alice@example.com.
  • Both Inbound A and Inbound B check nodeOnline.has("alice@example.com") → true → both show her online.

Before multi-inbound each client lived in exactly one inbound, so an active email implicitly belonged to one inbound only — the bug was latent but harmless. With multi-inbound clients the mismatch is visible.

What a fix would require

Xray does not expose per-inbound user traffic stats, so the online signal cannot be attributed to a specific inbound via the stats API alone. Potential approaches for a proper fix:

  1. Use Xray's connection API (if available) to list active sessions with their inbound tags.
  2. Track last-seen traffic delta per (email, inbound tag) pair from the inbound-level stat (inbound>>>tag>>>traffic>>>...) combined with knowledge of which clients belong to which inbound — but this is indirect and can double-count.
  3. As a UX mitigation: change the Inbounds page so that a client marked online is annotated with "online (on at least one inbound)" rather than implying connection specifically to this inbound.

Note on version: you reported 3.2.26 — the latest release is v3.2.6. If that was a typo, the bug is present. If you are actually running a different version, please confirm with x-ui → option to show version.

<!-- gh-comment-id:4612169606 --> @github-actions[bot] commented on GitHub (Jun 3, 2026): Thanks for the detailed report. This is a confirmed bug introduced in v3.1.0 when multi-inbound client support landed (#4469), and it differs from the cross-node bleeding fixed in #4809. **Root cause** Xray's stats API keys client traffic by email only — the counter names are `user>>>email>>>traffic>>>downlink/uplink` — with no inbound attribution. There is no per-inbound breakdown for user-level traffic. The polling job (`web/job/xray_traffic_job.go`) therefore builds `activeEmails` as a flat list of emails that had any traffic delta this tick, regardless of which inbound the traffic passed through. Those emails are stored in the local online set (`xray/process.go` → `onlineClients`), keyed by node (node 0 = local panel). The frontend rollup (`frontend/src/pages/inbounds/useInbounds.ts`, `rollupClients`) marks a client online for a given inbound if `nodeOnline.has(client.email)` — it only checks the node bucket, not which specific inbound the client is connected to. Because the node bucket contains all active emails regardless of inbound, every inbound that lists the client shows them as online. **Example**: - Client `alice@example.com` is attached to Inbound A and Inbound B (same panel, node 0). - She connects to Inbound A → Xray increments `user>>>alice@example.com>>>traffic>>>downlink`. - `activeEmails` includes `alice@example.com`. - The node-0 online set includes `alice@example.com`. - Both Inbound A and Inbound B check `nodeOnline.has("alice@example.com")` → `true` → both show her online. **Before multi-inbound** each client lived in exactly one inbound, so an active email implicitly belonged to one inbound only — the bug was latent but harmless. With multi-inbound clients the mismatch is visible. **What a fix would require** Xray does not expose per-inbound user traffic stats, so the online signal cannot be attributed to a specific inbound via the stats API alone. Potential approaches for a proper fix: 1. Use Xray's connection API (if available) to list active sessions with their inbound tags. 2. Track last-seen traffic delta per (email, inbound tag) pair from the inbound-level stat (`inbound>>>tag>>>traffic>>>...`) combined with knowledge of which clients belong to which inbound — but this is indirect and can double-count. 3. As a UX mitigation: change the Inbounds page so that a client marked online is annotated with "online (on at least one inbound)" rather than implying connection specifically to this inbound. **Note on version**: you reported `3.2.26` — the latest release is `v3.2.6`. If that was a typo, the bug is present. If you are actually running a different version, please confirm with `x-ui` → option to show version.
Author
Owner

@JohniGo76 commented on GitHub (Jun 3, 2026):

Sorry, typo 3.2.6 of course.

<!-- gh-comment-id:4612189308 --> @JohniGo76 commented on GitHub (Jun 3, 2026): Sorry, typo 3.2.6 of course.
Author
Owner

@JohniGo76 commented on GitHub (Jun 4, 2026):

3.2.7 not fix.

Image
<!-- gh-comment-id:4621756331 --> @JohniGo76 commented on GitHub (Jun 4, 2026): 3.2.7 not fix. <img width="1160" height="376" alt="Image" src="https://github.com/user-attachments/assets/386955cb-2273-4582-a6ed-087513db06d6" />
Author
Owner

@JohniGo76 commented on GitHub (Jun 9, 2026):

3.3.0 not fix.
As before, when connecting clients to different inbounds, any of them shows the same number of connected clients.

Image
<!-- gh-comment-id:4657213091 --> @JohniGo76 commented on GitHub (Jun 9, 2026): 3.3.0 not fix. As before, when connecting clients to different inbounds, any of them shows the same number of connected clients. <img width="756" height="291" alt="Image" src="https://github.com/user-attachments/assets/4e1664fd-0512-45bf-a213-6d7b5d82f5d7" />
Author
Owner

@MHSanaei commented on GitHub (Jun 9, 2026):

Panel show online per email not per inbound

<!-- gh-comment-id:4657221572 --> @MHSanaei commented on GitHub (Jun 9, 2026): Panel show online per email not per inbound
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#3390
No description provided.