3x-ui/web
MHSanaei 15787dbdfe
perf(clients): batch BulkAdjust per inbound, skip no-op xray calls on local
Same per-inbound batching strategy as BulkDelete. The previous code
called Update once per email, which itself looped through each inbound
the client belonged to — reparsing the same settings JSON, calling
RemoveUser+AddUser on xray, and running SyncInbound for every single
email. For 200 emails in one inbound that's 200 JSON read/write cycles
and 400 xray runtime calls.

The new BulkAdjust groups emails by inbound and per inbound:

- locks once, reads settings JSON once
- mutates expiryTime/totalGB in place for every target client
- writes the inbound and runs SyncInbound once

ClientTraffic rows are updated with a single per-email query at the end
(values differ per client so they can't be folded into one statement).

For local-node inbounds the xray runtime calls are skipped entirely.
The AddUser payload only contains email/id/security/flow/auth/password/
cipher — none of which change in an adjust — so RemoveUser+AddUser was
a no-op that briefly flapped active users. Limit enforcement is driven
by the panel's traffic loop reading ClientTraffic, not by xray-core.

For remote-node inbounds rt.UpdateUser is preserved so the remote panel
receives the new totals/expiry.

Skip+report semantics match BulkDelete: any per-email error leaves that
email's record/traffic untouched and is returned in Skipped[].
2026-05-27 00:30:40 +02:00
..
controller feat(clients): server-side bulk create/delete with per-inbound batching 2026-05-27 00:20:52 +02:00
entity feat(backend): gate request bodies with go-playground/validator 2026-05-25 19:17:54 +02:00
global Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00
job fix: address open bug reports (#4539, #4538, #4535, #4531, #4515) (#4545) 2026-05-25 00:08:06 +02:00
locale v3 2026-05-10 02:13:42 +02:00
middleware feat(backend): gate request bodies with go-playground/validator 2026-05-25 19:17:54 +02:00
network docs: add comments for all functions 2025-09-20 09:35:50 +02:00
runtime Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00
service perf(clients): batch BulkAdjust per inbound, skip no-op xray calls on local 2026-05-27 00:30:40 +02:00
session Security hardening: sessions, SSRF, CSP nonce, CSRF logout, trusted proxies (#4275) 2026-05-13 12:52:52 +02:00
translation feat(frontend): migrate DNS + Routing to Zod, align with xray docs 2026-05-26 23:36:01 +02:00
websocket fix(websocket): order register/unregister via single ops channel 2026-05-19 12:34:53 +02:00
web.go feat(frontend): TanStack Query + React Router migration & in-panel API docs (#4541) 2026-05-24 21:34:52 +02:00