3x-ui/frontend/src/test
Mr. Nickson ecadfd0e60
fix(clients): stop recomputing the summary badges from the client_stats snapshot (#6169)
* fix(clients): stop recomputing the summary badges from the client_stats snapshot

pickClientsSummary's coverage guard (serverSummary.total >
allClientStats.length) only catches a net shortfall: an orphaned
client_traffics row and a client still missing one can cancel out, or an
orphan surplus alone can pass uncaught, and either way the guard fails to
fall back (#6116).

client_paging.go's q.summary() already derives the same bucket counts with
clients as the driving table (LEFT JOIN client_traffics), so it cannot
miscount either shape regardless of how the row got there, and listQuery
already polls it every 5s — the same cadence client_stats ticks on. The
client-side recompute bought no fresher a number than the server already
provides on its own poll, only a window to get one wrong, so this drops it:
the summary badges now always read serverSummary directly. allClientStats,
computeClientsSummary, pickClientsSummary and sameSummaryInputs are removed
as dead code along with it; the per-row live traffic patch in
applyClientStatsEvent is untouched, since it reads the same snapshot by
email match rather than by count and was never exposed to this class of bug.

* fix(clients): force a refetch on window focus and drop a stale comment

Review feedback on PR #6169:

listQuery combines staleTime: Infinity with refetchInterval: 5000, which
pauses while the tab is hidden. The WS-driven per-row traffic patch in
applyClientStatsEvent has no such visibility gating, so on a background tab
a row's live numbers keep moving while the summary badges above them freeze
at whatever they were before the tab was hidden, and staleTime: Infinity
blocks refetchOnWindowFocus from closing that gap on return. Before this
PR the client-side recompute this branch removed happened to paper over the
same underlying gap; now that it's gone, the gap is directly visible.
refetchOnWindowFocus: 'always' forces exactly one refetch on refocus,
ignoring staleTime, without touching the interval/staleTime pairing that
governs the rest of this query's behavior.

Separately, useInbounds.ts still referenced computeClientsSummary by name
in a comment explaining bucket priority; that function no longer exists
after this PR. Dropped the comment rather than repoint it, per the repo's
no-//-comment convention.
2026-08-14 16:45:31 +02:00
..
__snapshots__ fix(xray): reject configs xray-core refuses, and check the fixtures against it 2026-07-28 14:43:55 +02:00
golden/fixtures fix(xray): reject configs xray-core refuses, and check the fixtures against it 2026-07-28 14:43:55 +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
app-sidebar.test.tsx fix(ui): reserve space for pinned sidebar 2026-07-30 14:52:38 +08: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-flow.test.tsx fix(clients): keep VLESS xtls-rprx-vision flow when inbound options reload (#5971) 2026-07-21 15:58:25 +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-query-gating.test.tsx fix(frontend): clean test validation output 2026-08-12 15:35:20 +02:00
clients-row-cells-memo.test.tsx perf(clients): make the clients page scale to large panels 2026-07-30 02:49:32 +02:00
clients-summary.test.tsx fix(clients): stop recomputing the summary badges from the client_stats snapshot (#6169) 2026-08-14 16:45:31 +02:00
date-time-picker.test.tsx fix(ui): commit date-picker selections immediately instead of on confirm (#6122) 2026-07-28 20:57:46 +02:00
default-setting-tag.test.tsx feat(ui): tag settings that sit at their shipped default value (#6128) 2026-07-29 08:03:21 +02:00
dns-presets.test.ts Add encrypted DNS presets (#5837) 2026-07-09 00:45:35 +02:00
dns-tab.test.tsx fix(frontend): keep DNS hosts synchronized (#6158) 2026-07-30 02:58:51 +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
factory-defaults-contract.test.ts feat(ui): tag settings that sit at their shipped default value (#6128) 2026-07-29 08:03:21 +02:00
finalmask.test.ts feat(xray): update xray-core to v26.7.28 and adapt panel 2026-07-28 13:14:06 +02:00
format-validation-error.test.ts feat(inbounds): clearer client validation errors on save 2026-05-31 22:41:58 +02:00
general-tab.test.tsx refactor(ui): share one onNumber handler for numeric setting inputs (#6127) 2026-07-28 23:03:13 +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 fix(frontend): preserve cancellation and reject invalid query data (#6143) 2026-07-29 20:51:40 +02:00
httpUtil.test.ts fix(frontend): clean test validation output 2026-08-12 15:35:20 +02:00
i18n-dead-keys.test.ts chore(i18n): delete 230 dead translation keys and guard against new ones (#6132) 2026-07-29 07:59:25 +02:00
inbound-defaults.test.ts feat(wireguard): multi-client support 2026-06-28 00:44:38 +02:00
inbound-form-adapter.test.ts inbounds: allow custom monthly traffic reset days (#6071) 2026-07-28 23:27:09 +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 feat(sub): Add XHTTP session field compatibility in share links and subscriptions (#5929) 2026-07-28 22:15:28 +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
on-number.test.ts refactor(ui): share one onNumber handler for numeric setting inputs (#6127) 2026-07-28 23:03:13 +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 fix(outbound): import Hysteria2 salamander properly from standard obfs params (#6166) 2026-08-14 16:43:29 +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-identity.test.ts feat(sub): allow identity tokens on every subscription link (#5935) 2026-07-28 22:12:52 +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 fix(frontend): clean test validation output 2026-08-12 15:35:20 +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
storybook-theme.test.tsx fix(frontend): preserve theme body classes (#6157) 2026-07-30 02:59:35 +02:00
stream-wire-normalize.test.ts feat(ui): validate the REALITY client version range at save time (#6126) 2026-07-28 23:04:03 +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 refactor(ui): share one onNumber handler for numeric setting inputs (#6127) 2026-07-28 23:03:13 +02:00
test-utils.tsx feat(ui): tag settings that sit at their shipped default value (#6128) 2026-07-29 08:03:21 +02:00
tunnel-rewriteport.test.ts fix(inbounds): accept null rewritePort in tunnel settings (#5516) (#5525) 2026-06-24 12:54:05 +02:00
use-all-settings.test.tsx fix(frontend): clean test validation output 2026-08-12 15:35:20 +02:00
use-xray-setting.test.tsx fix(frontend): preserve edited server drafts (#6156) 2026-07-30 02:59:53 +02:00
useServerDraft.test.tsx fix(frontend): preserve edited server drafts (#6156) 2026-07-30 02:59:53 +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
warp-change-ip.test.ts fix(warp): preserve outbound customization when rotating IP (#6052) 2026-07-21 15:50:00 +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
zodValidate.test.ts fix(frontend): clean test validation output 2026-08-12 15:35:20 +02:00