3x-ui/web
MHSanaei 756746dbca
perf(clients): make SyncInbound bulk to fix large-inbound timeouts (#4885)
Every client mutation funnels through SyncInbound, which ran O(n) DB
round-trips per call: one SELECT per client, a Save+UpdateColumn per
client, and a per-row junction INSERT. Toggling a single client on a
large inbound issued thousands of queries and timed out, badly so on
PostgreSQL where each round-trip pays TCP latency.

SyncInbound now:
- loads existing records with a single chunked SELECT ... email IN (...)
  instead of one query per client
- writes only the records that actually changed (skips no-op Saves), so
  toggling/editing one client writes one row, not all of them
- batch-creates new records and batch-inserts the junction rows

Merge and sticky-field semantics are unchanged. Measured on PostgreSQL
16: a single-client toggle on a 50k-client inbound drops from ~8m54s to
~0.9s, and seeding 50k clients from ~2m48s to ~1.6s; 200k clients sync
in seconds.

A skip-gated benchmark (web/service/sync_scale_postgres_test.go, run
with XUI_DB_TYPE=postgres) reproduces and verifies the scaling.
2026-06-04 18:14:25 +02:00
..
controller fix(multi-node): scope remote client update/delete to one inbound (#4892) 2026-06-04 16:45:40 +02:00
entity fix(settings): allow pagination size of 0 to disable pagination 2026-06-02 14:54:11 +02:00
global Feat/multi inbound clients (#4469) 2026-05-19 12:20:24 +02:00
job fix(online): scope per-inbound online to inbounds that carried traffic 2026-06-03 16:19:00 +02:00
locale v3 2026-05-10 02:13:42 +02:00
middleware feat: complete Zod migration of frontend + bulk client batching (#4599) 2026-05-27 04:26:50 +02:00
network docs: add comments for all functions 2025-09-20 09:35:50 +02:00
runtime fix(multi-node): scope remote client update/delete to one inbound (#4892) 2026-06-04 16:45:40 +02:00
service perf(clients): make SyncInbound bulk to fix large-inbound timeouts (#4885) 2026-06-04 18:14:25 +02:00
session Security hardening: sessions, SSRF, CSP nonce, CSRF logout, trusted proxies (#4275) 2026-05-13 12:52:52 +02:00
translation feat(migrate-db): SQLite <-> .dump conversion and Download Migration in Overview 2026-06-04 15:32:22 +02:00
websocket fix(websocket): order register/unregister via single ops channel 2026-05-19 12:34:53 +02:00
web.go feat(dashboard): more System History metrics, persistence & localized labels 2026-06-03 12:16:31 +02:00