[GH-ISSUE #5621] [Bug]: Existing inbound configurations are not displayed correctly. #3924

Closed
opened 2026-10-31 20:35:55 +07:00 by bsakaguchi · 2 comments
Owner

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

Image Image

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

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
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 ```shell ``` ### Screenshots <img width="585" height="1047" alt="Image" src="https://github.com/user-attachments/assets/520e48cc-944f-4668-89d8-c467b2899472" /> <img width="530" height="1065" alt="Image" src="https://github.com/user-attachments/assets/bc3c0f3e-60ac-47cb-89bc-4ab6924580e5" /> ### 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 - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:35:55 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@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/sessionKey to sessionIDPlacement/sessionIDKey to track xray-core v26.6.22 (#6258). The schema handles this rename via a migrateLegacyXhttp preprocessor inside XHttpStreamSettingsSchema (defined in frontend/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 stored xhttpSettings blob is injected directly into the Ant Design form store without going through XHttpStreamSettingsSchema.safeParse(). As a result, the rename migration is never applied. The form renders sessionIDPlacement / sessionIDKey form fields, finds undefined (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({}) (via newStreamSlice('xhttp') in InboundFormModal.tsx), which does apply the preprocessor and fills all defaults — which is why new inbounds look correct.

The fillStreamDefaults helper in frontend/src/lib/xray/stream-defaults.ts does run through the Zod schema and would apply the migration, but it is called only from frontend/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

  • Fields that were set before v3.4.0 under the old key names (sessionPlacement, sessionKey) show blank because rawInboundToFormValues passes the raw object to the form and the form only has Form.Item paths for the new key names.
  • Fields added in v3.4.0 (seqPlacement, seqKey, uplinkDataPlacement, uplinkDataKey, sessionIDTable, sessionIDLength) were not present in the stored JSON, so they also appear unset.
  • Fields that have not been renamed and were stored with an explicit value still display correctly.

Why saving does not help

When you save without correcting the blank fields, normalizeXhttpForWire (in frontend/src/lib/xray/stream-wire-normalize.ts) drops empty-string placement fields via dropEmptyStrings. The old sessionPlacement / sessionKey values 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 reads sessionIDPlacement / 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 streamSettings JSON directly. Find sessionPlacement and rename it to sessionIDPlacement; find sessionKey and rename it to sessionIDKey. Save. Re-open the inbound — the fields will now display correctly.

Fix location

frontend/src/lib/xray/inbound-form-adapter.ts, rawInboundToFormValues: after healStreamNetworkKey, the xhttpSettings sub-object should be run through XHttpStreamSettingsSchema.safeParse() (or fillStreamDefaults should 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.

<!-- gh-comment-id:4821350271 --> @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`/`sessionKey` to `sessionIDPlacement`/`sessionIDKey` to track xray-core v26.6.22 (#6258). The schema handles this rename via a `migrateLegacyXhttp` preprocessor inside `XHttpStreamSettingsSchema` (defined in `frontend/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 stored `xhttpSettings` blob is injected directly into the Ant Design form store without going through `XHttpStreamSettingsSchema.safeParse()`. As a result, the rename migration is never applied. The form renders `sessionIDPlacement` / `sessionIDKey` form fields, finds `undefined` (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({})` (via `newStreamSlice('xhttp')` in `InboundFormModal.tsx`), which does apply the preprocessor and fills all defaults — which is why new inbounds look correct. The `fillStreamDefaults` helper in `frontend/src/lib/xray/stream-defaults.ts` does run through the Zod schema and would apply the migration, but it is called only from `frontend/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** - Fields that were set before v3.4.0 under the old key names (`sessionPlacement`, `sessionKey`) show blank because `rawInboundToFormValues` passes the raw object to the form and the form only has `Form.Item` paths for the new key names. - Fields added in v3.4.0 (`seqPlacement`, `seqKey`, `uplinkDataPlacement`, `uplinkDataKey`, `sessionIDTable`, `sessionIDLength`) were not present in the stored JSON, so they also appear unset. - Fields that have not been renamed and were stored with an explicit value still display correctly. **Why saving does not help** When you save without correcting the blank fields, `normalizeXhttpForWire` (in `frontend/src/lib/xray/stream-wire-normalize.ts`) drops empty-string placement fields via `dropEmptyStrings`. The old `sessionPlacement` / `sessionKey` values 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 reads `sessionIDPlacement` / `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 `streamSettings` JSON directly. Find `sessionPlacement` and rename it to `sessionIDPlacement`; find `sessionKey` and rename it to `sessionIDKey`. Save. Re-open the inbound — the fields will now display correctly. **Fix location** `frontend/src/lib/xray/inbound-form-adapter.ts`, `rawInboundToFormValues`: after `healStreamNetworkKey`, the `xhttpSettings` sub-object should be run through `XHttpStreamSettingsSchema.safeParse()` (or `fillStreamDefaults` should 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.*
Author
Owner

@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.

<!-- gh-comment-id:4863440230 --> @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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3924
No description provided.