mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4792] [Bug]: VLESS Reality flow is not saved or cleared on multi-inbound client (VLESS + Hysteria) still present in v3.2.6 #3328
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#3328
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?
Originally created by @VMMaster on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4792
Describe the bug
After upgrading to version 3.2.5, a bug appeared when saving a client that is attached to multiple inbounds at the same time: Hysteria and VLESS Reality. I have just updated to version 3.2.6, but unfortunately, the issue still persists.
How to reproduce the problem
xtls-rprx-visionin the flow setting.Expected behavior
The
flowparameter should be correctly stored and rendered per-inbound, regardless of whether the client shares other non-VLESS inbounds (like Hysteria), just like it used to work flawlessly in version 3.2.0.Actual behavior
flowsetting is preserved correctly upon reopening.flowfield (it fails to hydrate the form/UI dropdown).flowvalue is saved on the main node during the initial setup, but it completely fails to save on the additional node. Re-opening the card wipes the flow setting, forcing the admin to re-select it every single time.Relevant logs
Screenshots
When adding only vless reality, everything will be saved well even if the main and additional node are selected
I added all the Vless + Hysteria connections, the primary and secondary nodes, selected flow xtls-rprx-vision, saved it, and went back to the card, but it was empty.
The user in the screenshots deleted it, it was created for the sake of testing.
3x-ui version
3.2.6
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
ubuntu 24.04
Which parts of the panel are affected?
Xray config generation
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 2, 2026):
Thanks for the detailed report and screenshots — this is a real bug that can be traced to a specific line in the backend.
Root cause
When a client is saved to multiple inbounds,
SyncInbound(web/service/client.go) is called once per inbound. Each call unconditionally overwrites theClientRecord.Flowcolumn in theclientstable with whatever flow value the current inbound carries:Because
clientWithInboundFlow()correctly strips the flow to""for Hysteria (which does not support XTLS Vision), the Hysteria sync call writes an empty string intoClientRecord.Flow. If Hysteria is processed after VLESS Reality, the canonical flow field ends up empty in the database.The per-inbound
flow_overridecolumn in theclient_inboundsjunction table is set correctly (VLESS Reality keeps"xtls-rprx-vision", Hysteria keeps""). However, the clients-list API (/api/clients/list) returnsClientRecord.Flow— the now-empty value — not the junction-table override. This is what the edit form reads at load time, so the dropdown appears blank.Why the "additional node" also fails
The multi-node sync path calls
SyncInboundwith the same set of inbound clients, so it hits the identical overwrite and ends up withClientRecord.Flow = ""on the secondary node as well.Minimal fix direction
In
SyncInbound, only overwriteClientRecord.Flowwhen the incoming value is non-empty, so a non-flow-capable inbound (Hysteria, WS, gRPC, etc.) cannot silently erase the canonical flow that a flow-capable inbound already stored:Alternatively, the clients-list response could derive the display flow from the first flow-capable
FlowOverrideentry, making it independent of inbound processing order.If you are able to patch your own build in the meantime, the one-liner above in
SyncInboundaround line 227 should restore the previous behaviour.@VMMaster commented on GitHub (Jun 2, 2026):
In PostgreSQL, the client_inbounds table
5 and 7 inbound_id are hysteria
This is the clients table
@MHSanaei commented on GitHub (Jun 2, 2026):
Fixed. The edit form now loads the correct flow for multi-inbound clients.
Root cause:
SyncInboundruns once per inbound and unconditionally sets canonicalclients.Flow. A non-flow inbound (Hysteria, WS, gRPC) strips flow to"", so when it syncs after the VLESS Reality inbound it wipes the column. The hydrate endpoint returned that wiped value, so the dropdown loaded blank. The per-inboundclient_inbounds.flow_overridewas always correct (as your DB dump showed).Fix: hydrate now derives the flow from the first flow-capable
flow_override(order-independent) instead of the canonical column.I went with this over the simpler
if incoming.Flow != "" { ... }guard inSyncInboundon purpose — that guard would make flow impossible to clear (picking "no flow" leaves every inbound at"", so the old value would stick). Added regression tests for both the Hysteria-synced-last order and the cleared-flow case.Note: this corrects the panel display/persistence. The actual xray config and share links already used the correct per-inbound flow, so connectivity wasn't affected — but the blank form could trick you into re-saving a cleared flow.