From b770287995315f81d79c798a2fde8f5bacb58617 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 12 Jun 2026 22:35:05 +0200 Subject: [PATCH] fix(sub): stop appending the node name to subscription remarks (#5231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The #5035 change tagged node-hosted entries with the node name to disambiguate multi-node subscriptions, but the node name is panel-internal and leaked into the profile names end users see in their client apps. Drop the suffix entirely — remarks are the admin-set inbound remark again. --- internal/sub/service.go | 13 ------------- internal/sub/service_test.go | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/internal/sub/service.go b/internal/sub/service.go index 916a52efe..d9b40770c 100644 --- a/internal/sub/service.go +++ b/internal/sub/service.go @@ -1528,19 +1528,6 @@ func (s *SubService) genRemark(inbound *model.Inbound, email string, extra strin if len(extra) > 0 { orders['o'] = extra } - // A node-hosted inbound usually shares its remark with the local copy it - // was synced from, so a multi-node subscription would list several - // identically-named entries differing only by address (#5035). Tag such - // entries with the node name unless the admin already put it in the remark. - if inbound.NodeID != nil && s.nodesByID != nil { - if n, ok := s.nodesByID[*inbound.NodeID]; ok && n != nil && n.Name != "" && !strings.Contains(orders['i'], n.Name) { - if orders['i'] != "" { - orders['i'] += "@" + n.Name - } else { - orders['i'] = n.Name - } - } - } var remark []string for i := 0; i < len(orderChars); i++ { diff --git a/internal/sub/service_test.go b/internal/sub/service_test.go index 71b5209cd..f6f3a0835 100644 --- a/internal/sub/service_test.go +++ b/internal/sub/service_test.go @@ -26,6 +26,21 @@ func TestSubscriptionExpiryFromClient(t *testing.T) { } } +// The name an admin gives a node is panel-internal and must not leak into +// the remarks end users see in their client apps (#5231) — not even for +// node-hosted inbounds, which briefly carried a node-name suffix (#5035). +func TestGenRemarkOmitsNodeName(t *testing.T) { + nodeID := 7 + s := &SubService{ + remarkModel: "-ieo", + nodesByID: map[int]*model.Node{7: {Id: 7, Name: "Berlin", Address: "node7.example.com"}}, + } + ib := &model.Inbound{Remark: "vless-tcp", NodeID: &nodeID} + if got := s.genRemark(ib, "", ""); got != "vless-tcp" { + t.Fatalf("remark = %q, want %q (node name must not leak into client-visible remarks)", got, "vless-tcp") + } +} + func TestFindClientIndex(t *testing.T) { clients := []model.Client{ {Email: "a@example.com"},