mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #7098] fix(sub): let balancers select inbounds that are hidden from the subscription #6650
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#6650
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/7098
Author: @mjbe71
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:fix/sub-balancer-hidden-inbounds📝 Commits (1)
f18da47fix(sub): let balancers select inbounds that are hidden from the subscription📊 Changes
2 files changed (+171 additions, -15 deletions)
View changed files
📝
internal/sub/json_service.go(+62 -15)➕
internal/sub/sub_balancer_hidden_test.go(+109 -0)📄 Description
Problem
An inbound with ExcludeFromSub was skipped before its configs were built, and appendBalancerEntries only reads the inbound entries that reach the output. A hidden inbound could therefore never become a balancer member, although the balancer form lists it.
Design
Behaviour change
A balancer that selects a hidden inbound now contains its outbound. This only happens when an admin explicitly selects that inbound in a balancer; its outbound (address, credentials) is then visible inside that balancer document.
This also applies to existing data: an inbound that is already hidden and already selected in an enabled balancer starts appearing inside that balancer after the upgrade, without any action from the admin. Previously such a selection was silently ignored.
The balancer document is only served to subscribers who are already clients of that inbound, so this exposes nothing to anyone who did not already have its credentials.
Tests
TestSubJson_BalancerMemberFromHiddenInbound(legacy and hosts-first): the hidden inbound appears only inside the balancer doc.TestSubJson_BalancerOfOnlyHiddenInbound: a balancer with only hidden members still renders.TestSubJson_HiddenBalancerMemberKeepsFirstLinkRemark: rendering a hidden member does not swallow the first-link remark tokens.Written test-first; the first two fail on main for the reported reason, and the third fails if the remark tokens are not restored after rendering a hidden member.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.