3x-ui/frontend/src/test
H-TTTTT a9d5d9afdb
fix(balancer): pin loopback routing rules ahead of general rules (#6054)
* fix(balancer): pin loopback routing rules ahead of general rules

ensureBalancerLoopback appended a balancer's fallback loopback rule
({ inboundTag: ['_bl_<target>'], balancerTag: <target> }) to the END of
routing.rules via Array.push, and only updated balancerTag in place when
the rule already existed. Xray evaluates routing rules top-to-bottom,
first match wins, and a general domain rule (no inboundTag restriction)
matches every inbound including the loopback one. So once such a general
rule targeting the parent balancer ended up earlier in the array — added
before the fallback was configured, or recreated later by an edit or by
ensureMissingBalancerLoopbacks — the fallback re-entered routing through
the _bl_<target> loopback outbound, the general rule matched again, and
traffic routed straight back into the parent balancer: an unbounded loop
and the CPU spike in the report. detectBalancerCycles only catches
mutual fallback cycles, so the plain acyclic Balancer1 -> Balancer2
chain passed silently.

Insert the loopback rule before the first general (no-inboundTag) rule
instead of pushing to the end, and reposition any existing loopback rule
that already landed after a general rule (preserving its other fields,
mirroring the EnsureStatsRouting hoist used for the same class of bug).
Rules with an inboundTag restriction (api, real inbounds) are left in
place — they can never match loopback traffic, so only the unrestricted
rules are dangerous. ensureMissingBalancerLoopbacks runs on every Save
All and calls ensureBalancerLoopback per fallback, so this also repairs
configs loaded from the DB with the wrong order.

Fixes #5960

* ci: re-trigger checks after flaky FuzzDecodeCertPin timeout

---------

Co-authored-by: x06579 <x06579@ai-dashboard>
2026-07-21 15:48:34 +02:00
..
__snapshots__ fix: stop forcing port 53 on DoH/DoQ DNS server entries (#5950) 2026-07-14 12:55:10 +02:00
golden/fixtures feat(xray): update xray-core to v26.7.11 and adapt panel 2026-07-12 00:30:47 +02:00
msw Frontend dev tooling (Husky, lint-staged, MSW, Storybook) + full React Hook Form migration (#5859) 2026-07-08 13:28:37 +02:00
api-token-date.test.tsx fix(settings): require re-2FA confirmation for sensitive setting changes (#5610) 2026-06-28 15:17:15 +02:00
balancer-form-modal.test.tsx feat(balancer): add balancer-to-balancer fallback support (#5586) 2026-07-09 01:59:51 +02:00
balancer-loopback.test.ts fix(balancer): pin loopback routing rules ahead of general rules (#6054) 2026-07-21 15:48:34 +02:00
balancer-observatory-sync.test.ts fix(balancers): keep mixed strategies on one observer (#5674) 2026-07-02 18:18:30 +02:00
balancer.test.ts feat: complete Zod migration of frontend + bulk client batching (#4599) 2026-05-27 04:26:50 +02:00
basics-happy-eyeballs.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
client-card-comment.test.tsx feat(frontend): show client comments on mobile cards (#5942) 2026-07-14 12:59:55 +02:00
client-form-modal.test.tsx [Feature]: Add a tooltip/hint to the "Password" field in the client form clarifying which protocols use it (#5809) 2026-07-07 14:43:09 +02:00
client-total-bytes.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
client-traffic-display.test.ts feat(clients): restore traffic usage progress bars on Clients page (#5150) 2026-06-11 12:10:49 +02:00
clients-summary.test.ts fix(clients): keep the summary card live without a page refresh 2026-06-01 06:10:25 +02:00
dns-presets.test.ts Add encrypted DNS presets (#5837) 2026-07-09 00:45:35 +02:00
dns.test.ts fix: stop forcing port 53 on DoH/DoQ DNS server entries (#5950) 2026-07-14 12:55:10 +02:00
finalmask.test.ts feat(finalmask): support Salamander packetSize (Gecko) and Realm tlsConfig for Hysteria2 (#5278) 2026-06-15 00:21:31 +02:00
format-validation-error.test.ts feat(inbounds): clearer client validation errors on save 2026-05-31 22:41:58 +02:00
generated-examples.test.ts feat(api-docs): generate OpenAPI components/schemas from Go structs 2026-06-06 16:22:21 +02:00
headers.test.ts feat: complete Zod migration of frontend + bulk client batching (#4599) 2026-05-27 04:26:50 +02:00
host-link.test.ts fix(sub): bake Host VLESS Route into subscription UUIDs 2026-06-29 14:32:23 +02:00
host-schema.test.ts fix(sub): bake Host VLESS Route into subscription UUIDs 2026-06-29 14:32:23 +02:00
http-init-msw.test.ts Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
http-init.test.tsx refactor(frontend): replace axios with the native Fetch API 2026-07-08 01:09:18 +02:00
httpUtil.test.ts Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
inbound-defaults.test.ts feat(wireguard): multi-client support 2026-06-28 00:44:38 +02:00
inbound-form-adapter.test.ts fix(xhttp): stop XMUX maxConcurrency from reverting on save 2026-07-11 20:43:47 +02:00
inbound-form-blocks.test.tsx Frontend dev tooling (Husky, lint-staged, MSW, Storybook) + full React Hook Form migration (#5859) 2026-07-08 13:28:37 +02:00
inbound-form-modal.test.tsx fix: resolve a batch of open bug-tagged issues (traffic accounting, share strategy, sub address, CPU) (#5477) 2026-06-22 00:22:28 +02:00
inbound-from-db.test.ts fix: enable XTLS vision flow for VLESS+XHTTP+vlessenc in UI and share links (#5157) (#5185) 2026-06-11 12:04:02 +02:00
inbound-full.test.ts feat: complete Zod migration of frontend + bulk client batching (#4599) 2026-05-27 04:26:50 +02:00
inbound-link.test.ts fix(sub): bake Host VLESS Route into subscription UUIDs 2026-06-29 14:32:23 +02:00
inbound-tag.test.ts fix(inbounds): drop listen address from auto-generated inbound tag 2026-06-01 09:33:49 +02:00
link-label.test.ts feat(mtproto): adopt dolonet/mtg-multi and make MTProto inbounds multi-client 2026-07-06 16:04:32 +02:00
log-parse.test.ts fix(mtproto): reap orphaned mtg, fix SysLog viewer, mtg log visibility, export remark (#5105) (#5107) 2026-06-09 04:01:33 +02:00
mtproto-clients-link.test.ts fix(mtproto): drop the remark fragment from tg proxy deep links 2026-07-06 17:55:35 +02:00
node-list-rowkey.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
observatory-settings-tab.test.tsx fix(balancers): keep mixed strategies on one observer (#5674) 2026-07-02 18:18:30 +02:00
outbound-defaults.test.ts refactor(wireguard): drop removed workers field (xray v26.6.22) (#5509) 2026-06-23 16:23:02 +02:00
outbound-form-adapter.test.ts fix(xhttp): stop XMUX maxConcurrency from reverting on save 2026-07-11 20:43:47 +02:00
outbound-form-modal.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
outbound-link-parser.test.ts Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
outbound-tag-rename.test.ts fix(xray): sync routing rules when outbound tag is renamed (#5006) 2026-06-08 20:30:41 +02:00
outbounds-loopback-index.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
panel-version.test.ts feat(panel): surface dev-build version in UI, bot, and CLI 2026-06-25 02:36:41 +02:00
protocol-capabilities.test.ts feat: complete Zod migration of frontend + bulk client batching (#4599) 2026-05-27 04:26:50 +02:00
protocols.test.ts Test-quality audit: fix 2 prod bugs, strengthen weak tests, add mutation/fuzz/CI tooling (#5345) 2026-06-15 15:17:03 +02:00
remark-template-field.test.tsx feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
remark-variables.test.ts feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
rhf-form-field.test.tsx Frontend dev tooling (Husky, lint-staged, MSW, Storybook) + full React Hook Form migration (#5859) 2026-07-08 13:28:37 +02:00
routing-default-outbound.test.ts feat(xray): default outbound in basic routing (#5815) 2026-07-09 01:55:47 +02:00
routing-loopback-index.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
routing-reference-cleanup.test.ts fix(balancers): keep mixed strategies on one observer (#5674) 2026-07-02 18:18:30 +02:00
rule-form-preserve-fields.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
rule.test.ts feat: complete Zod migration of frontend + bulk client batching (#4599) 2026-05-27 04:26:50 +02:00
security.test.ts fix(reality): load dest as target alias so existing inbounds aren't wiped (#5295) 2026-06-15 00:25:10 +02:00
setting-ldap-skip-verify.test.ts feat: ldap skip tls verify (#5637) 2026-06-28 18:10:38 +02:00
setting-sub-updates.test.ts fix(ui): align the subUpdates limit with the backend and show the range 2026-07-05 20:12:21 +02:00
setup.components.ts refactor(frontend): replace axios with the native Fetch API 2026-07-08 01:09:18 +02:00
setup.msw.ts Frontend dev tooling (Husky, lint-staged, MSW, Storybook) + full React Hook Form migration (#5859) 2026-07-08 13:28:37 +02:00
setup.ts feat: complete Zod migration of frontend + bulk client batching (#4599) 2026-05-27 04:26:50 +02:00
size-formatter.test.ts feat(ui): show per-inbound live speed (#5261) 2026-06-14 22:39:40 +02:00
sniffing-field-resync.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
sockopt.test.ts feat: complete Zod migration of frontend + bulk client batching (#4599) 2026-05-27 04:26:50 +02:00
speed-tag-stable.test.tsx fix(frontend): stabilize speed tags on inbound and client pages (#5930) 2026-07-14 13:00:25 +02:00
spider-x.test.ts feat(reality): derive a stable per-client spiderX for shared links 2026-07-02 12:53:08 +02:00
stream-wire-normalize.test.ts fix(xhttp): stop XMUX maxConcurrency from reverting on save 2026-07-11 20:43:47 +02:00
stream.test.ts feat(xray): update xray-core to v26.7.11 and adapt panel 2026-07-12 00:30:47 +02:00
subscription-general-tab.test.tsx feat(sub): auto-detect subscription format by User-Agent (Updated) (#5826) 2026-07-14 13:01:40 +02:00
test-utils.tsx refactor(frontend): reorganize source tree & break down oversized modals/tabs (#4698) 2026-05-30 21:51:33 +02:00
tunnel-rewriteport.test.ts fix(inbounds): accept null rewritePort in tunnel settings (#5516) (#5525) 2026-06-24 12:54:05 +02:00
vless-encryption.test.ts fix(web): sync the VLESS generate-key dropdown with the encryption field 2026-07-02 17:37:04 +02:00
websocket-bridge-outbounds.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
websocket-shared-client.test.tsx Repo-wide self-correcting audit: 54 verified bug fixes (#5970) 2026-07-17 00:33:06 +02:00
wireguard-client-config.test.ts fix(panel): use the hosting node address for WireGuard client configs (#5679) 2026-07-03 01:12:32 +02:00
wireguard-clients-link.test.ts feat(wireguard): multi-client support 2026-06-28 00:44:38 +02:00
xhttp-session-id.test.ts feat(xhttp): support sessionID* rename + sessionIDTable/Length (xray v26.6.22) (#5506) 2026-06-23 17:38:16 +02:00