diff --git a/frontend/src/lib/xray/stream-wire-normalize.ts b/frontend/src/lib/xray/stream-wire-normalize.ts index fddb1c6a4..4dee44196 100644 --- a/frontend/src/lib/xray/stream-wire-normalize.ts +++ b/frontend/src/lib/xray/stream-wire-normalize.ts @@ -267,7 +267,6 @@ export function normalizeSockoptForWire( const he = out.happyEyeballs; if (isRecord(he)) { const heOut: Record = { ...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; diff --git a/frontend/src/test/stream-wire-normalize.test.ts b/frontend/src/test/stream-wire-normalize.test.ts index cac527736..16e9f88bb 100644 --- a/frontend/src/test/stream-wire-normalize.test.ts +++ b/frontend/src/test/stream-wire-normalize.test.ts @@ -213,6 +213,14 @@ describe('normalizeSockoptForWire', () => { expect(out?.happyEyeballs).toEqual({ tryDelayMs: 250 }); }); + + it('keeps an explicit tryDelayMs of 0 so it cannot rehydrate as the 250 default', () => { + const out = normalizeSockoptForWire({ + happyEyeballs: { tryDelayMs: 0, prioritizeIPv6: true, interleave: 1, maxConcurrentTry: 4 }, + }); + + expect(out?.happyEyeballs).toEqual({ tryDelayMs: 0, prioritizeIPv6: true }); + }); }); describe('normalizeStreamSettingsForWire reality', () => {