[GH-ISSUE #5772] [Bug]: VLESS Key Generation dropdown always resets to "X25519 (native)" regardless of the initially selected option #4016

Closed
opened 2026-10-31 20:36:33 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @BaseBlank on GitHub (Jul 3, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5772

Describe the bug

When editing a VLESS inbound, the Key Generation dropdown UI does not restore its previous state.

Regardless of which of the 6 options (e.g., ML-KEM-768 (random), X25519 (xorpub), etc.) was initially selected to generate the keys, the dropdown always resets and displays the first default option: X25519 (native) when the edit panel is reopened.

While the actual decryption and encryption strings are saved and loaded correctly from the backend, the frontend UI fails to reverse-parse these strings to restore the correct selected state of the dropdown. This stateless behavior is visually misleading for users, making it look like their configuration has been downgraded or lost.

How to reproduce the problem

  1. Open the Inbounds page.
  2. Create a new VLESS inbound.
  3. In the Protocol settings, click the Key Generation dropdown and select ANY option other than the first one (e.g., select ML-KEM-768 (random) or X25519 (xorpub)).
  4. Click Generate to populate the Decryption and Encryption fields.
  5. Click Save to create the inbound.
  6. Close the panel (or refresh the page) and reopen it.
  7. Click Edit on the newly created VLESS inbound.
  8. Observe the Key Generation dropdown. It will incorrectly display X25519 (native).

Expected behavior

I expected the frontend panel to parse the loaded decryption string (e.g., detecting identifiers like mlkem768x25519plus, .random., .xorpub., etc.) during the edit modal initialization, and automatically bind the dropdown to the correct matching option.

Actual behavior

Instead, the panel always resets the dropdown to X25519 (native) during the edit modal initialization, ignoring the actual format of the saved keys.

Relevant logs

No backend errors. This is purely a frontend UI state initialization/binding issue.

Screenshots

No response

3x-ui version

3.4.2

Xray-core version

26.6.27

How did you install 3x-ui?

install.sh script

Operating system

Debian 12

Which parts of the panel are affected?

Frontend (UI / panel pages)

Browser (only if it is a UI bug)

Chrome

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 @BaseBlank on GitHub (Jul 3, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5772 ### Describe the bug When editing a VLESS inbound, the Key Generation dropdown UI does not restore its previous state. Regardless of which of the 6 options (e.g., `ML-KEM-768 (random)`, `X25519 (xorpub)`, etc.) was initially selected to generate the keys, the dropdown always resets and displays the first default option: `X25519 (native)` when the edit panel is reopened. While the actual `decryption` and `encryption` strings are saved and loaded correctly from the backend, the frontend UI fails to reverse-parse these strings to restore the correct selected state of the dropdown. This stateless behavior is visually misleading for users, making it look like their configuration has been downgraded or lost. ### How to reproduce the problem 1. Open the `Inbounds` page. 2. Create a new `VLESS` inbound. 3. In the Protocol settings, click the Key Generation dropdown and select ANY option other than the first one (e.g., select `ML-KEM-768 (random)` or `X25519 (xorpub)`). 4. Click `Generate` to populate the Decryption and Encryption fields. 5. Click `Save` to create the inbound. 6. Close the panel (or refresh the page) and reopen it. 7. Click `Edit` on the newly created VLESS inbound. 8. Observe the Key Generation dropdown. It will incorrectly display `X25519 (native)`. ### Expected behavior I expected the frontend panel to parse the loaded `decryption` string (e.g., detecting identifiers like `mlkem768x25519plus`, `.random.`, `.xorpub.`, etc.) during the edit modal initialization, and automatically bind the dropdown to the correct matching option. ### Actual behavior Instead, the panel always resets the dropdown to `X25519 (native)` during the edit modal initialization, ignoring the actual format of the saved keys. ### Relevant logs ```shell No backend errors. This is purely a frontend UI state initialization/binding issue. ``` ### Screenshots _No response_ ### 3x-ui version 3.4.2 ### Xray-core version 26.6.27 ### How did you install 3x-ui? install.sh script ### Operating system Debian 12 ### Which parts of the panel are affected? Frontend (UI / panel pages) ### Browser (only if it is a UI bug) Chrome ### 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:36:33 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jul 3, 2026):

This is the same issue as #5744, which is already fixed on main but not yet in a tagged release.

Confirmed in the source: on main, frontend/src/pages/inbounds/form/protocols/vless.tsx now initializes the authKind dropdown state from a vlessAuthKind prop (useState<VlessAuthKind>(vlessAuthKind ?? 'x25519'), with a useEffect to keep it in sync when the prop changes), instead of the old hardcoded useState<VlessAuthKind>('x25519'). That prop is computed in frontend/src/pages/inbounds/form/InboundFormModal.tsx via a new shared helper, vlessEncryptionAuthKind() in frontend/src/lib/xray/vless-encryption.ts, which parses the dot-delimited encryption string (mode marker native/xorpub/random plus key length to distinguish x25519 vs mlkem768) and is used for both the "Already selected" label and the dropdown's initial/synced value, so the two can no longer diverge.

That fix landed in commit 97e2c9e ("fix(web): sync the VLESS generate-key dropdown with the encryption field"), merged 2026-07-02, three days after the v3.4.2 tag (2026-06-29) you're running. It is not in any tagged release yet.

Closing as a duplicate of #5744; further discussion should continue there. You can track when it ships in a release via the releases page, or build from main in the meantime if you need it sooner.

This reply was generated automatically. A maintainer may follow up.

<!-- gh-comment-id:4878585986 --> @github-actions[bot] commented on GitHub (Jul 3, 2026): This is the same issue as #5744, which is already fixed on `main` but not yet in a tagged release. Confirmed in the source: on `main`, `frontend/src/pages/inbounds/form/protocols/vless.tsx` now initializes the `authKind` dropdown state from a `vlessAuthKind` prop (`useState<VlessAuthKind>(vlessAuthKind ?? 'x25519')`, with a `useEffect` to keep it in sync when the prop changes), instead of the old hardcoded `useState<VlessAuthKind>('x25519')`. That prop is computed in `frontend/src/pages/inbounds/form/InboundFormModal.tsx` via a new shared helper, `vlessEncryptionAuthKind()` in `frontend/src/lib/xray/vless-encryption.ts`, which parses the dot-delimited `encryption` string (mode marker `native`/`xorpub`/`random` plus key length to distinguish `x25519` vs `mlkem768`) and is used for both the "Already selected" label and the dropdown's initial/synced value, so the two can no longer diverge. That fix landed in commit `97e2c9e` ("fix(web): sync the VLESS generate-key dropdown with the encryption field"), merged 2026-07-02, three days after the `v3.4.2` tag (2026-06-29) you're running. It is not in any tagged release yet. Closing as a duplicate of #5744; further discussion should continue there. You can track when it ships in a release via the [releases page](https://github.com/MHSanaei/3x-ui/releases), or build from `main` in the meantime if you need it sooner. *This reply was generated automatically. A maintainer may follow up.*
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#4016
No description provided.