mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5621] [Bug]: Existing inbound configurations are not displayed correctly. #3924
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#3924
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 @Ramazik on GitHub (Jun 27, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5621
Describe the bug
I'll attach two screenshots. One is with an existing xhttp inbound, and the other is with a newly created one.
In the existing inbound (created in previous versions of 3x-ui, well before version 3.4.1), fields marked with a question mark are not displayed, despite having previously set parameters. Setting and saving the parameters again doesn't solve the problem. In the existing inbound, the parameters marked with a green checkmark were never entered manually; they were automatically populated with these default values when created in previous versions of 3x-ui.
I noted the differences in the screenshot with the newly created inbound. I didn't create a new inbound and test what values would be displayed. My machine is installed on a production system and can't experiment too much.
I haven't tested how these bugs manifest themselves in other inbounds besides xhttp.
How to reproduce the problem
the problem is described above
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
3x-ui version
3.4.1
Xray-core version
26.6.22
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Which parts of the panel are affected?
Frontend (UI / panel pages)
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 27, 2026):
This is a genuine regression in v3.4.0, confirmed by source inspection.
Root cause
v3.4.0 (PR #5506) renamed the XHTTP session keys from
sessionPlacement/sessionKeytosessionIDPlacement/sessionIDKeyto track xray-core v26.6.22 (#6258). The schema handles this rename via amigrateLegacyXhttppreprocessor insideXHttpStreamSettingsSchema(defined infrontend/src/schemas/protocols/stream/xhttp.ts). That preprocessor runs only when data is passed through the Zod schema.The edit-modal path does not do that. In
frontend/src/lib/xray/inbound-form-adapter.ts(rawInboundToFormValues), the raw storedxhttpSettingsblob is injected directly into the Ant Design form store without going throughXHttpStreamSettingsSchema.safeParse(). As a result, the rename migration is never applied. The form renderssessionIDPlacement/sessionIDKeyform fields, findsundefined(the stored object has the old keys), and the selects appear blank.By contrast, when you create a new inbound the form calls
XHttpStreamSettingsSchema.parse({})(vianewStreamSlice('xhttp')inInboundFormModal.tsx), which does apply the preprocessor and fills all defaults — which is why new inbounds look correct.The
fillStreamDefaultshelper infrontend/src/lib/xray/stream-defaults.tsdoes run through the Zod schema and would apply the migration, but it is called only fromfrontend/src/lib/xray/inbound-from-db.ts(the subscription/display path), not from the form adapter used by the edit modal.What you see in the edit form
sessionPlacement,sessionKey) show blank becauserawInboundToFormValuespasses the raw object to the form and the form only hasForm.Itempaths for the new key names.seqPlacement,seqKey,uplinkDataPlacement,uplinkDataKey,sessionIDTable,sessionIDLength) were not present in the stored JSON, so they also appear unset.Why saving does not help
When you save without correcting the blank fields,
normalizeXhttpForWire(infrontend/src/lib/xray/stream-wire-normalize.ts) drops empty-string placement fields viadropEmptyStrings. The oldsessionPlacement/sessionKeyvalues from the DB are carried in the form store as unregistered fields and may persist in the wire payload, but the xray-core engine (v26.6.22) no longer reads those old keys at runtime — it only readssessionIDPlacement/sessionIDKey. The missing migration step is therefore also a correctness issue, not only a display issue.Workaround (until fixed)
Use the Advanced tab → Stream sub-editor to edit the raw
streamSettingsJSON directly. FindsessionPlacementand rename it tosessionIDPlacement; findsessionKeyand rename it tosessionIDKey. Save. Re-open the inbound — the fields will now display correctly.Fix location
frontend/src/lib/xray/inbound-form-adapter.ts,rawInboundToFormValues: afterhealStreamNetworkKey, thexhttpSettingssub-object should be run throughXHttpStreamSettingsSchema.safeParse()(orfillStreamDefaultsshould be called on the full stream record) so the rename preprocessor and field defaults are applied before the form store is populated.This reply was generated automatically; a maintainer may follow up.
@MHSanaei commented on GitHub (Jul 2, 2026):
Fixed in
539bcc89: the edit modal now runs stored xhttpSettings through the schema migration, so inbounds saved before the sessionPlacement/sessionKey rename display correctly and never emit the legacy keys on save. Until the release lands, the workaround remains renaming the keys via the Advanced JSON tab.