mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #7096] fix(sub): render nothing when every host of an inbound is excluded from a format #6648
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#6648
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/7096
Author: @mjbe71
Created: 11/7/2026
Status: 🔄 Open
Base:
main← Head:fix/sub-all-hosts-excluded📝 Commits (4)
911179bfix(sub): render nothing when every host of an inbound is excluded from a format498a646fix(frontend): mirror the all-hosts-excluded rule in the panel's host links2e0cc9ddocs(sub): shorten the hostEndpoints doc comment to two lines35e87f3test(frontend): stop pinning the bare-inbound fallback for excluded Hosts📊 Changes
14 files changed (+333 additions, -30 deletions)
View changed files
📝
frontend/src/lib/hosts/host-link.ts(+19 -0)📝
frontend/src/pages/clients/tunnelEndpoints.ts(+4 -3)📝
frontend/src/pages/inbounds/InboundsPage.tsx(+11 -2)📝
frontend/src/pages/inbounds/info/InboundInfoModal.tsx(+10 -3)➕
frontend/src/test/host-all-excluded.test.ts(+95 -0)📝
frontend/src/test/host-link.test.ts(+17 -0)📝
frontend/src/test/tunnel-host-endpoints.test.ts(+6 -1)📝
internal/sub/clash_service.go(+6 -1)➕
internal/sub/host_all_excluded_test.go(+126 -0)📝
internal/sub/host_order.go(+9 -2)📝
internal/sub/host_sub.go(+13 -13)📝
internal/sub/json_service.go(+6 -1)📝
internal/sub/links.go(+4 -1)📝
internal/sub/service.go(+7 -3)📄 Description
Problem
hostEndpointsandsubscriptionHostVariantsreturned the same empty result for "inbound has no enabled hosts" and "all enabled hosts are excluded from this format". An inbound whose hosts were all hidden from raw, json or clash therefore fell back to its bare address and appeared in that subscription anyway.Fix
The all-excluded case is now reported separately and renders nothing, in raw, json and clash, in both the legacy and hosts-first sort modes, and in
inboundLinks/LinkProvider. Traffic accounting and the usage header are kept, the same as for a client bound to a format-excluded host (TestSub_ClientHostRule_FormatExcludedFailsClosed).Behaviour change
An inbound that has enabled hosts, all of them excluded from a format, no longer appears in that format. Inbounds with no hosts, or only disabled hosts, render as before (covered by a test).
allHostsExcludedinhost-link.ts.Tests
TestSub_AllHostsFormatExcluded_RendersNothing: 2 sort modes x 3 formats, checks nothing is rendered, usage is kept, and the other formats still render.TestSub_OnlyDisabledHosts_StillRendersInbound: disabled hosts are not "excluded".TestLinkProvider_AllHostsRawExcluded_NoLinks:LinksForClient/LinksForInbounds.Written test-first; they fail on
mainfor the reported reason.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.