fix(ui): keep an explicit zero happy-eyeballs delay across the round trip

Follow-up found in review: the wire normalizer still stripped
tryDelayMs when it equaled 0, but with the schema default now 250 a
reload rehydrates the missing field as 250 - a user who explicitly set
0 ("disabled", per the field's own placeholder) would see 250 and any
subsequent save would silently enable a delay they turned off. Keep
tryDelayMs on the wire unconditionally; it is the one happy-eyeballs
field whose presence changes xray's behavior.

Refs #5780
This commit is contained in:
MHSanaei
2026-07-05 21:17:12 +02:00
parent 0753f5ee83
commit 9d1a21b484
2 changed files with 8 additions and 1 deletions
@@ -267,7 +267,6 @@ export function normalizeSockoptForWire(
const he = out.happyEyeballs;
if (isRecord(he)) {
const heOut: Record<string, unknown> = { ...he };
if (heOut.tryDelayMs === 0) delete heOut.tryDelayMs;
if (heOut.prioritizeIPv6 === false) delete heOut.prioritizeIPv6;
if (heOut.interleave === 1) delete heOut.interleave;
if (heOut.maxConcurrentTry === 4) delete heOut.maxConcurrentTry;