mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6528] [MERGED] fix(panel): read the outbound protocol id in the Outbounds row like the core #6335
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#6335
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/6528
Author: @BlindMaster24
Created: 9/14/2026
Status: ✅ Merged
Merged: 9/14/2026
Merged by: @BlindMaster24
Base:
main← Head:fix/outbounds-address-column-case📝 Commits (4)
b374e5cfix(panel): read the outbound protocol id in the address column like the core4f05774fix(panel): fill the outbound address column from one protocol-id ruleb070daffix(panel): read the vnext shape of a vless outbound in the address column6510284fix(panel): read the protocol id of the outbound stream tags like the core📊 Changes
4 files changed (+154 additions, -14 deletions)
View changed files
📝
frontend/src/pages/xray/outbounds/outbounds-tab-helpers.ts(+18 -11)📝
frontend/src/pages/xray/outbounds/useOutboundColumns.tsx(+3 -3)➕
frontend/src/test/outbound-identity-tags-case.test.tsx(+60 -0)➕
frontend/src/test/outbounds-addresses-case.test.ts(+73 -0)📄 Description
Summary
The Outbounds row reads the outbound's protocol id the way the core does. Three readers were involved, all display-only:
outboundAddressesswitched ono.protocolwith exactcaselabels, so a row spelled"VMess"fell through todefaultand rendered an empty Address column.caseforhysteriaoramneziawg— both selectable in the outbound form — so a canonically spelled row was blank too, and its VLESS branch read only the flatsettings.address/port, so avnext-shaped row rendered a bare:.includes()over four ids, so the same"VMess"row rendered without itsws/tlstags.Why
The core lowercases the id in
LoadWithID(infra/conf/loader.go:46at the pinned revision52a412d9e2f5), so a template that spells an outbound"VMess"runs normally. The panel's readers do not all agree; these were the ones left in the Outbounds row.Scenario. An operator's template comes from elsewhere — pasted, generated by another tool, hand-edited — and spells an outbound
"VMess"with populatedsettings.vnext. On the Outbounds page the row is otherwise healthy: the tag is right, the protocol label is right, the Test button works. Only the Address column is blank and the stream tags are missing, even though both are in the settings. The same blank cell appears in the card view and in the subscription outbounds table, which read through the same helper. Nothing breaks functionally, but a row that looks like it has no server is exactly what sends someone to re-create an outbound that was already correct.The hysteria/amneziawg half needs no unusual spelling at all: pick those protocols in the outbound form and the Address cell is blank from the moment the row is created.
Reproduced before the fix, which is what the new tests pin:
What changed
outbounds-tab-helpers.ts: the switch routes through the sharedisOutboundProtocol(schemas/primitives/outbound-protocol.ts), the module that owns the rule, instead of folding the id inline —isUntestable, two functions below it in the same file, already reads it that way. The VLESS branch readsvnextfirst and falls back to the flat pair, the order the probe's extractor uses (internal/web/service/outbound/outbound.go:259-269), which also stops it emitting a bare:.hysteriajoins that branch andamneziawgjoins thepeersbranch, the shape each form writes.useOutboundColumns.tsx: the identity cell asksisOutboundProtocolper id instead ofincludes(record.protocol as never).Relationship to #6526 and #6527. All three are the same defect — a reader of a protocol id disagreeing with the core — split by subject: #6526 is the probe's lane gate and endpoint extractor (Go), #6527 is the probe's untestable gate (Go batch gate +
isUntestable), and this is the Outbounds row. #6527 touchesisUntestablein this same file; the hunks do not overlap, so whichever merges second needs no more than a trivial rebase.Type of change
Areas affected
How was this tested?
frontend/src/test/outbounds-addresses-case.test.ts— 11 cases: the three case-variant spellings, thevnext-shaped VLESS row, the VLESS flat fallback, hysteria, amneziawg, and four controls that are unchanged either way (a canonical"vmess"row, a"freedom"row that legitimately carries no address, a VLESS row with no server, a capitalised DNS row).frontend/src/test/outbound-identity-tags-case.test.tsx— rendersOutboundsTabwith a"VMess"row and asserts the identity cell's tags are exactly['VMess', 'ws', 'tls']and that the row showsa.example.com:443.Each of the seven assertions above was watched red with its fix reverted and green with it restored.
Gates run locally (Node 24):
npm run lint— 0 warnings, 0 errors;npm run format:check— clean;npm run typecheck— clean;npm run build— passes, andgen:apileft no generated artefact dirty.npx vitest run --project unit— 73 of 75 files pass. The two failures are not from this change:input-number-guard.test.ts(expected [] to have a length of 3) fails on the pristine tree too, in isolation, and lints a fixture undertools/oxlint/that this PR does not touch;language-scope.test.tspasses in isolation (2.7s against the default 5s timeout) and only fails inside the full run.npx vitest run --project components— 54 of 56 pass, and the failing files differ from run to run (inbound-form-modal.test.tsx,calendar-expire-setting.test.tsx,geodata-section.test.tsx,subscription-general-tab.test.tsxacross three runs); each passes in isolation and none imports this PR's modules. Thestorybookproject was not run here — chromium is not installed in this environment; CI covers it.Screenshots / recordings
N/A — no markup changed; the assertions above cover the rendered value.
Breaking changes
None. Canonical spellings produce byte-identical output; only rows the core already runs and the readers previously misread change, and they change from a blank cell to the address and tags that are in the settings.
Checklist
go build ./...and the test suite pass locally. — No Go file is touched by this PR.npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.