From ed9686bf295c5f6a395bb500ae036b994cff548b Mon Sep 17 00:00:00 2001 From: mrnickson-hue Date: Fri, 10 Jul 2026 13:20:35 +0300 Subject: [PATCH] fix(clients): include Telegram ID in client list search (#5888) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(clients): include Telegram ID in client list search clientMatchesSearch only checked Email/SubID/Comment/UUID/Password/Auth, so searching the client list for a Telegram user ID never matched even though the field is stored on every client. This is a real regression, not a field that was simply never included: before the paged search endpoint (#4500), the frontend searched with ObjectUtil.deepSearch() over the full client object, which recursed into every field including tgId. Replacing that with a fixed backend field list silently dropped it (along with a few other fields, but tgId is the one that's actually needed here since it's the panel's own way of looking a client up when it only knows their Telegram ID). TgID is int64 (0 = unset), so it can't sit in the existing []string candidates array — matched separately via strconv, and skipped when 0 to avoid a needle of "0" spuriously matching every client without a Telegram ID. Fixes #5880 * fix(clients): drop explanatory comment, mention Telegram ID in search hint Addresses review feedback on #5888: - Removed the // comment block above the TgID check in clientMatchesSearch per repo convention (code should read on its own). - Updated searchPlaceholder in all 13 locale files to mention Telegram ID, since the search box now actually matches on it. * test(clients): remove TgID search test per maintainer request --- internal/web/service/client_paging.go | 3 +++ internal/web/translation/ar-EG.json | 2 +- internal/web/translation/en-US.json | 2 +- internal/web/translation/es-ES.json | 2 +- internal/web/translation/fa-IR.json | 2 +- internal/web/translation/id-ID.json | 2 +- internal/web/translation/ja-JP.json | 2 +- internal/web/translation/pt-BR.json | 2 +- internal/web/translation/ru-RU.json | 2 +- internal/web/translation/tr-TR.json | 2 +- internal/web/translation/uk-UA.json | 2 +- internal/web/translation/vi-VN.json | 2 +- internal/web/translation/zh-CN.json | 2 +- internal/web/translation/zh-TW.json | 2 +- 14 files changed, 16 insertions(+), 13 deletions(-) diff --git a/internal/web/service/client_paging.go b/internal/web/service/client_paging.go index bcdc02a39..ff317fde3 100644 --- a/internal/web/service/client_paging.go +++ b/internal/web/service/client_paging.go @@ -290,6 +290,9 @@ func clientMatchesSearch(c ClientWithAttachments, needle string) bool { return true } } + if c.TgID != 0 && strings.Contains(strconv.FormatInt(c.TgID, 10), needle) { + return true + } return false } diff --git a/internal/web/translation/ar-EG.json b/internal/web/translation/ar-EG.json index 2fc21cebd..b7dd60ca2 100644 --- a/internal/web/translation/ar-EG.json +++ b/internal/web/translation/ar-EG.json @@ -775,7 +775,7 @@ "renew": "تجديد تلقائي", "renewDesc": "تجديد تلقائي بعد انتهاء الصلاحية. (0 = تعطيل) (الوحدة: يوم)", "renewDays": "تجديد تلقائي (أيام)", - "searchPlaceholder": "ابحث بالبريد، التعليق، sub ID، UUID، كلمة المرور، auth…", + "searchPlaceholder": "ابحث بالبريد، التعليق، sub ID، UUID، كلمة المرور، auth، Telegram ID…", "filterTitle": "تصفية العملاء", "clearAllFilters": "مسح الكل", "filters": { diff --git a/internal/web/translation/en-US.json b/internal/web/translation/en-US.json index bdbac3a55..f4157901b 100644 --- a/internal/web/translation/en-US.json +++ b/internal/web/translation/en-US.json @@ -775,7 +775,7 @@ "renew": "Auto Renew", "renewDesc": "Auto-renewal after expiration. (0 = disable)(unit: day)", "renewDays": "Auto Renew (days)", - "searchPlaceholder": "Search email, comment, sub ID, UUID, password, auth…", + "searchPlaceholder": "Search email, comment, sub ID, UUID, password, auth, Telegram ID…", "filterTitle": "Filter clients", "clearAllFilters": "Clear all", "filters": { diff --git a/internal/web/translation/es-ES.json b/internal/web/translation/es-ES.json index db754ff25..76f139059 100644 --- a/internal/web/translation/es-ES.json +++ b/internal/web/translation/es-ES.json @@ -775,7 +775,7 @@ "renew": "Renovación automática", "renewDesc": "Renovación automática tras la expiración. (0 = desactivado) (unidad: día)", "renewDays": "Renovación automática (días)", - "searchPlaceholder": "Buscar email, comentario, sub ID, UUID, contraseña, auth…", + "searchPlaceholder": "Buscar email, comentario, sub ID, UUID, contraseña, auth, Telegram ID…", "filterTitle": "Filtrar clientes", "clearAllFilters": "Limpiar todo", "filters": { diff --git a/internal/web/translation/fa-IR.json b/internal/web/translation/fa-IR.json index 87a419e42..1c9c45bd5 100644 --- a/internal/web/translation/fa-IR.json +++ b/internal/web/translation/fa-IR.json @@ -775,7 +775,7 @@ "renew": "تمدید خودکار", "renewDesc": "تمدید خودکار پس از انقضا. (۰ = غیرفعال) (واحد: روز)", "renewDays": "تمدید خودکار (روز)", - "searchPlaceholder": "جستجوی ایمیل، توضیح، Sub ID، UUID، رمز، احراز...", + "searchPlaceholder": "جستجوی ایمیل، توضیح، Sub ID، UUID، رمز، احراز، Telegram ID...", "filterTitle": "فیلتر کاربران", "clearAllFilters": "پاک کردن همه", "filters": { diff --git a/internal/web/translation/id-ID.json b/internal/web/translation/id-ID.json index 449653372..295fe207e 100644 --- a/internal/web/translation/id-ID.json +++ b/internal/web/translation/id-ID.json @@ -775,7 +775,7 @@ "renew": "Perpanjangan otomatis", "renewDesc": "Perpanjangan otomatis setelah kedaluwarsa. (0 = nonaktif) (satuan: hari)", "renewDays": "Perpanjangan otomatis (hari)", - "searchPlaceholder": "Cari email, komentar, sub ID, UUID, kata sandi, auth…", + "searchPlaceholder": "Cari email, komentar, sub ID, UUID, kata sandi, auth, Telegram ID…", "filterTitle": "Filter klien", "clearAllFilters": "Hapus semua", "filters": { diff --git a/internal/web/translation/ja-JP.json b/internal/web/translation/ja-JP.json index 4d5ee72f3..05c3de42a 100644 --- a/internal/web/translation/ja-JP.json +++ b/internal/web/translation/ja-JP.json @@ -775,7 +775,7 @@ "renew": "自動更新", "renewDesc": "有効期限切れ後に自動更新します。(0 = 無効) (単位: 日)", "renewDays": "自動更新 (日)", - "searchPlaceholder": "メール、コメント、sub ID、UUID、パスワード、auth を検索…", + "searchPlaceholder": "メール、コメント、sub ID、UUID、パスワード、auth、Telegram ID を検索…", "filterTitle": "クライアントをフィルタ", "clearAllFilters": "すべてクリア", "filters": { diff --git a/internal/web/translation/pt-BR.json b/internal/web/translation/pt-BR.json index 239257be4..2b82826f2 100644 --- a/internal/web/translation/pt-BR.json +++ b/internal/web/translation/pt-BR.json @@ -775,7 +775,7 @@ "renew": "Renovação automática", "renewDesc": "Renovação automática após a expiração. (0 = desativar) (unidade: dia)", "renewDays": "Renovação automática (dias)", - "searchPlaceholder": "Buscar email, comentário, sub ID, UUID, senha, auth…", + "searchPlaceholder": "Buscar email, comentário, sub ID, UUID, senha, auth, Telegram ID…", "filterTitle": "Filtrar clientes", "clearAllFilters": "Limpar tudo", "filters": { diff --git a/internal/web/translation/ru-RU.json b/internal/web/translation/ru-RU.json index a1c1f18f9..c5c43ae43 100644 --- a/internal/web/translation/ru-RU.json +++ b/internal/web/translation/ru-RU.json @@ -775,7 +775,7 @@ "renew": "Автопродление", "renewDesc": "Автоматическое продление после окончания. (0 = отключено) (единица: день)", "renewDays": "Автопродление (дней)", - "searchPlaceholder": "Поиск email, комментария, sub ID, UUID, пароля, auth…", + "searchPlaceholder": "Поиск email, комментария, sub ID, UUID, пароля, auth, Telegram ID…", "filterTitle": "Фильтр клиентов", "clearAllFilters": "Очистить все", "filters": { diff --git a/internal/web/translation/tr-TR.json b/internal/web/translation/tr-TR.json index 4ff8417d2..4a8e523c8 100644 --- a/internal/web/translation/tr-TR.json +++ b/internal/web/translation/tr-TR.json @@ -775,7 +775,7 @@ "renew": "Otomatik Yenileme", "renewDesc": "Süre dolduktan sonra otomatik yeniler. (0 = devre dışı) (birim: gün)", "renewDays": "Otomatik Yenileme (gün)", - "searchPlaceholder": "E-posta, yorum, sub ID, UUID, parola, auth ara…", + "searchPlaceholder": "E-posta, yorum, sub ID, UUID, parola, auth, Telegram ID ara…", "filterTitle": "Kullanıcıları Filtrele", "clearAllFilters": "Tümünü Temizle", "filters": { diff --git a/internal/web/translation/uk-UA.json b/internal/web/translation/uk-UA.json index 97d06fbe7..d9946d618 100644 --- a/internal/web/translation/uk-UA.json +++ b/internal/web/translation/uk-UA.json @@ -775,7 +775,7 @@ "renew": "Авто-продовження", "renewDesc": "Автоматичне продовження після закінчення. (0 = вимкнено) (одиниця: день)", "renewDays": "Авто-продовження (днів)", - "searchPlaceholder": "Пошук email, коментаря, sub ID, UUID, паролю, auth…", + "searchPlaceholder": "Пошук email, коментаря, sub ID, UUID, паролю, auth, Telegram ID…", "filterTitle": "Фільтр клієнтів", "clearAllFilters": "Очистити все", "filters": { diff --git a/internal/web/translation/vi-VN.json b/internal/web/translation/vi-VN.json index adb4b6bc9..9ffe40e05 100644 --- a/internal/web/translation/vi-VN.json +++ b/internal/web/translation/vi-VN.json @@ -775,7 +775,7 @@ "renew": "Tự động gia hạn", "renewDesc": "Tự động gia hạn sau khi hết hạn. (0 = tắt) (đơn vị: ngày)", "renewDays": "Tự động gia hạn (ngày)", - "searchPlaceholder": "Tìm email, ghi chú, sub ID, UUID, mật khẩu, auth…", + "searchPlaceholder": "Tìm email, ghi chú, sub ID, UUID, mật khẩu, auth, Telegram ID…", "filterTitle": "Lọc client", "clearAllFilters": "Xóa tất cả", "filters": { diff --git a/internal/web/translation/zh-CN.json b/internal/web/translation/zh-CN.json index 5bf4a7706..1303b270b 100644 --- a/internal/web/translation/zh-CN.json +++ b/internal/web/translation/zh-CN.json @@ -775,7 +775,7 @@ "renew": "自动续期", "renewDesc": "到期后自动续期。(0 = 禁用) (单位: 天)", "renewDays": "自动续期 (天)", - "searchPlaceholder": "搜索邮箱、备注、sub ID、UUID、密码、auth…", + "searchPlaceholder": "搜索邮箱、备注、sub ID、UUID、密码、auth、Telegram ID…", "filterTitle": "筛选客户端", "clearAllFilters": "清除全部", "filters": { diff --git a/internal/web/translation/zh-TW.json b/internal/web/translation/zh-TW.json index e18199a82..218ee21e2 100644 --- a/internal/web/translation/zh-TW.json +++ b/internal/web/translation/zh-TW.json @@ -775,7 +775,7 @@ "renew": "自動續期", "renewDesc": "到期後自動續期。(0 = 停用) (單位: 天)", "renewDays": "自動續期 (天)", - "searchPlaceholder": "搜尋電子郵件、備註、sub ID、UUID、密碼、auth…", + "searchPlaceholder": "搜尋電子郵件、備註、sub ID、UUID、密碼、auth、Telegram ID…", "filterTitle": "篩選客戶端", "clearAllFilters": "清除全部", "filters": {