You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Database Status & Integrity Check: Integrated real-time inspection querying file size, WAL size, and running PRAGMA integrity_check(1);.
Optimize Database: Added one-click database optimization executing PRAGMA wal_checkpoint(TRUNCATE);, PRAGMA optimize;, and ANALYZE; to rebuild query planner statistics and optimize table index access.
Database Vacuum (Space Reclamation): Added database VACUUM functionality to defragment database pages and reclaim unused disk space, reporting the exact amount of reclaimed storage.
Purge Corrupted & Orphaned Rows: Built automated multi-table scanner and cleaner to safely remove:
Orphaned traffic records (client_traffics) with empty emails or pointing to deleted inbounds.
Ghost traffic records belonging to clients no longer present in node clients or inbound settings.
Broken and duplicate node client links (node_client_links).
Corrupted node client records (node_clients) with missing emails.
Orphaned and invalid client IP bindings (inbound_client_ips).
Database Maintenance REST API:
Added new REST API endpoints documented in API.md:
POST / GET/panel/setting/dbStatus - Retrieve database size, WAL size, integrity check, and corrupted row counts.
POST/panel/setting/optimizeDatabase - Run WAL checkpoint, analyze, and optimize pragmas.
POST/panel/setting/vacuumDatabase - Defragment database and reclaim storage.
POST/panel/setting/cleanDatabase - Purge corrupted and orphaned database entries.
Multilingual Localization:
Added comprehensive localization across all 13 supported languages (en_US, fa_IR, zh_CN, zh_TW, ru_RU, ar_EG, es_ES, id_ID, ja_JP, pt_BR, tr_TR, uk_UA, vi_VN) for all new maintenance controls, prompts, and toasts.
🐛 Bug Fixes & Stability
Fix Depleted Client Reconnection on Traffic Reset:
Resolved variable shadowing in resetTrafficUnlocked where reEnabled was masked inside the database retry closure, preventing depleted clients from being dynamically added back to running inbounds in Xray-core via API upon resetting traffic.
Depleted clients whose traffic is reset now reconnect immediately without requiring a manual Xray-core restart.
Guarded hotAddUserToInbound with inbound enable state and dynamically re-adds sibling clients when client sync is active.
Routed ResetClientTrafficByEmail through ResetClientTraffic to ensure external resets (e.g., Telegram bot) properly hot-add clients to Xray-core and flag core restart when needed.
Elimination of Database Locks on Multi-Inbound Client Deletion:
Resolved database is locked error occurring when deleting clients linked to multiple inbounds on the first attempt.
Synchronized DelInboundClient and DelInboundClientByEmail with nodeClientOpMutex to prevent race conditions with background node client operations.
Wrapped multi-inbound client deletion and unlink routines in exponential backoff retry loops (database.ExecWithRetry).
Elimination of Database Locks on Traffic Resets:
Fixed database lock contention when resetting client and inbound traffic (ResetClientTrafficByEmail, ResetAllClientTraffics, ResetAllTraffics) by wrapping transactions in retry loops with progressive backoff.
Type Correction in Traffic Addition:
Corrected return variable typing in autoRenewClients call within AddTraffic to prevent compilation and runtime evaluation mismatch.
Configured SQLite connection DSN with _txlock=immediate along with WAL mode and busy timeout (_journal_mode=WAL&_busy_timeout=10000&_synchronous=NORMAL&_txlock=immediate).
Preemptively obtains SQLite write locks on transaction start, completely eliminating lock-upgrade deadlocks caused by concurrent read-then-write transactions during background traffic synchronization.
Transaction Retry Engine (retry.go):
Introduced database.ExecWithRetry and database.WithRetry[T] utility functions with exponential backoff and random jitter to absorb transient SQLite lock contention without failing user-facing requests.