3x-ui/web/job
Abdalrahman 78f1719c6d
fix: prevent online clients from randomly disappearing from panel UI (#4387)
* fix: prevent online clients from randomly disappearing from panel UI

Online status was determined solely by whether a client transferred
bytes in the current 5-second polling window. The online list was
completely replaced each cycle, so idle-but-connected clients with no
traffic delta in that window were dropped from the UI.

Now online status is computed from lastOnline DB timestamps with a
5-second grace period via RefreshOnlineClientsFromMap(), so clients
remain visible across idle polling windows.

Closes #4384

* fix: extend online client grace period to survive idle poll cycles

The 5s grace period equalled the traffic-poll interval, so a client
whose Xray stats reported a zero delta for one cycle was still dropped
on the very next tick. Bump to 20s (~4 polls) so idle-but-connected
sessions stay visible across momentary counter gaps without lingering
long after a real disconnect.

Refs #4384

---------

Co-authored-by: MHSanaei <ho3ein.sanaei@gmail.com>
2026-05-15 11:41:29 +02:00
..
check_client_ip_job.go fix(iplog): parse xray access-log timestamps in local time 2026-05-13 21:50:16 +02:00
check_client_ip_job_integration_test.go v3 2026-05-10 02:13:42 +02:00
check_client_ip_job_test.go iplimit: dont count idle db-only ips toward the per-client limit 2026-04-23 21:11:45 +03:00
check_cpu_usage.go v3 2026-05-10 02:13:42 +02:00
check_hash_storage.go v3 2026-05-10 02:13:42 +02:00
check_xray_running_job.go v3 2026-05-10 02:13:42 +02:00
clear_logs_job.go v3 2026-05-10 02:13:42 +02:00
ldap_sync_job.go v3 2026-05-10 02:13:42 +02:00
node_heartbeat_job.go feat(nodes): traffic-writer queue, full-mirror sync, WS event fixes 2026-05-10 16:25:23 +02:00
node_traffic_sync_job.go fix: prevent online clients from randomly disappearing from panel UI (#4387) 2026-05-15 11:41:29 +02:00
periodic_traffic_reset_job.go v3 2026-05-10 02:13:42 +02:00
stats_notify_job.go v3 2026-05-10 02:13:42 +02:00
xray_traffic_job.go fix: prevent online clients from randomly disappearing from panel UI (#4387) 2026-05-15 11:41:29 +02:00