mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #5492] [CLOSED] fix(online): gate local inbounds correctly when xray is idle #5900
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5900
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5492
Author: @younesvatan78
Created: 6/22/2026
Status: ❌ Closed
Base:
main← Head:fix/online-inbound-gate📝 Commits (1)
1b35826fix(online): gate local inbounds correctly when xray is idle📊 Changes
1 file changed (+10 additions, -4 deletions)
View changed files
📝
internal/web/service/inbound_node.go(+10 -4)📄 Description
Summary
Multi-inbound clients appeared online on every inbound they were attached to, even when only one of those inbounds had active traffic. The bug surfaced whenever the local xray had no recent traffic (grace window expired between polls, or xray just started).
Root cause
GetActiveInboundsByGuidreturned an empty map{}whenGetLocalActiveInboundsreturned nil (no active inbounds in the grace window). The frontend distinguishes two states by whether the GUID key is present in the map:{}— key absent{guid: []}— empty sliceBecause the local panel's GUID was missing when idle,
activeByGuidRef.current.get(guid)returnedundefined, and theundefined === undefinedfallback inrollupClientsungated all local inbounds — every client appeared online on all their inbounds regardless of which one carried traffic.Fix
Resolve the GUID before checking the active list, and always emit
{guid: active}(whereactivemay be an empty slice). A missing key still means "unknown remote node — don't gate", which is the correct semantic for nodes that haven't reported yet. Only the local panel is guaranteed to always know its own state.Test plan
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.