fix(clients): keep VLESS xtls-rprx-vision flow when inbound options reload (#5971)

The client form cleared the `flow` field whenever `showFlow` was false, but
`showFlow` is derived from the inbound options list, which is transiently empty
while the options query (re)loads (`inboundOptionsQuery.data ?? []`). During
that window `showFlow` is a false negative, so the effect silently dropped a
valid `xtls-rprx-vision` flow the user had picked for a Reality/TLS inbound and
never restored it — the client was then saved with an empty flow and could not
connect with XTLS Vision.

Guard the clear so it only runs once the inbound options are actually available.

Adds a regression test that reproduces the drop across an options reload.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Blazethan
2026-07-21 21:58:25 +08:00
committed by GitHub
parent 8cd71e07ea
commit 9e117bbdd3
2 changed files with 77 additions and 2 deletions
@@ -373,10 +373,15 @@ export default function ClientFormModal({
}
useEffect(() => {
if (!showFlow && flow) {
// Only clear the flow once we actually have inbound options to judge
// capability from. While the options list is momentarily empty (e.g. the
// options query is (re)loading and `inbounds` falls back to `[]`), showFlow
// is a false negative, so clearing here would silently drop a valid
// xtls-rprx-vision flow the user picked for a Reality/TLS inbound.
if (inbounds.length > 0 && !showFlow && flow) {
methods.setValue('flow', '');
}
}, [showFlow, flow, methods]);
}, [inbounds, showFlow, flow, methods]);
useEffect(() => {
if (!showReverseTag && reverseTag) {